An AI system to help scientists write expert-level empirical software