3 ms·
If anyone wants to play with these ideas in Clojure(script), take a look at the SICMUtils project: https://github.com/littleredcomputer/sicmutils https://githu
by sritchie 6y ago
If anyone wants to play with these ideas in Clojure(script), take a look at the SICMUtils project: https://github.com/littleredcomputer/sicmutils https://github.com/littleredcomputer/sicmutils
I picked up co-maintenance on this project a few months ago; it's a Clojure port of the computer algebra system behind Sussmans' "Structure and Interpretation of Classical Mechanics" [0] and "Functional Differential Geometry" [1], and can run all the code from those books. (I'm currently working on integrating it into https://Maria.cloud https://Maria.cloud so all of this will be usable from the browser.)
`sicmutils.generic.simplify` plugs in to a rule-based term rewriting system like Mathematica's, along with polynomial and rational function simplification.
The core idea of the library is that if you build everything on top of extensible generic arithmetic operators (multimethods in Clojure), then a lot of good stuff shows up for free:
- If I implement all the operations for symbols, I get a symbolic arithmetic system for free.
- Extend the generics to Dual numbers[2]? Boom, forward-mode AD pops out!
I'm getting carried away. Check it out, get your term-rewriting fix.
[0] https://mitpress.mit.edu/books/structure-and-interpretation-classical-mechanics-second-edition https://mitpress.mit.edu/books/structure-and-interpretation-...
[1] https://mitpress.mit.edu/books/functional-differential-geometry https://mitpress.mit.edu/books/functional-differential-geome...
[2] https://en.wikipedia.org/wiki/Dual_number https://en.wikipedia.org/wiki/Dual_number
- agambrahma 6y agoThis is really cool. Remember coming across SICM a long time ago, feel it gets under-appreciated because it's perhaps too niche (not enough of the "SICP crowd" cares about the physics, people who care about the physics don't come across it). A Clojure version will ensure it lives on longer (the one downside of these old books is how closely they're tied to MIT-Scheme)