Have you looked at SICM? (Structure and Interpretation of Classical Mechanics, the far less popular half-sibling of the SICP)
https://mitpress.mit.edu/books/structure-and-interpretation-... -it has you derive classical mechanics, which is to say most(
) of Newtonian physics up to around 1900, by writing a giant pile of scheme that drives graphical simulations.(
) For a curious value of "most" that elides thermodynamics, electromagnetism, etc..