We present Diffstar, a smooth parametric model for the in situ star formation history (SFH) of galaxies. The Diffstarmodel is distinct from traditional SFH models because it is parametrized directly in terms of basic features of galaxy formation physics. Diffstarincludes ingredients for: the halo mass assembly history; the accretion of gas into the dark matter halo; the fraction of gas that is eventually transformed into stars, epsilon(ms); the time-scale over which this transformation occurs, tau(cons); and the possibility that some galaxies will experience a quenching event at time t(q), and may subsequently experience rejuvenated star formation. We show that our model is sufficiently flexible to describe the average stellar mass histories of galaxies in both the IllustrisTNG(TNG) and UniverseMachine (UM) simulations with an accuracy of similar to 0.1 dex across most of cosmic time. We use Diffstarto compare TNG to UM in common physical terms, finding that: (i) star formation in UM is less efficient and burstier relative to TNG; (ii) UM galaxies have longer gas consumption time-scales, relative to TNG; (iii) rejuvenated star formation is ubiquitous in UM, whereas quenched TNG galaxies rarely experience sustained rejuvenation; and (iv) in both simulations, the distributions of epsilon(ms), tau(cons), and t(q) share a common characteristic dependence upon halo mass, and present significant correlations with halo assembly history. We conclude with a discussion of how Diffstarcan be used in future applications to fit the SEDs of individual observed galaxies, as well as in forward-modelling applications that populate cosmological simulations with synthetic galaxies.