3 ms·
SICMUtils co-author here, if anyone has any questions on the Clojure port. One beautiful thing about a Clojure computer algebra system is that it can run compl
by sritchie 6y ago
SICMUtils co-author here, if anyone has any questions on the Clojure port.
One beautiful thing about a Clojure computer algebra system is that it can run completely in the browser. This includes automatic differentiation, numerical integration, all of the hardcore Lagrangian and Hamiltonian mechanics work, differential geometry... it is startling stuff.
For example, here's a(n interactive!) derivation of Kepler's Third Law in the browser (thanks to Nextjournal's lovely integration), if anyone wants to play: https://nextjournal.com/try/sicm/ex-1-11 https://nextjournal.com/try/sicm/ex-1-11
Many more exercises live here: https://nextjournal.com/sicm/ https://nextjournal.com/sicm/
- ChrisRackauckas 6y agoYes, we found these and this (along with Mathematica) was the impetus for building automated Latexification into Symbolics.jl. Here for example is a teaching notebook used in Alan Edelman's MIT Computational Thinking course where Symbolics.jl is used to visualize the numerical methods as they iterate, and all of the outputs convert to LaTeX: https://computationalthinking.mit.edu/Spring21/newton_method/ https://computationalthinking.mit.edu/Spring21/newton_method... Thanks for the ideas!
- philzook 6y agoThose are gorgeous. How were they done? Using Julia packages?
- ChrisRackauckas 6y agoThis is a Pluto notebook over Symbolics.jl and ForwardDiff. All of the packages used are at the top of the page. You can click the edit button on the top right to open it up.
- ChrisRackauckas 6y agoForgot to mention: Shashi cites SICMUtils as a big influence for the rewrite system SymbolicUtils.jl, which is the rewrite system underneath Symbolics.jl. https://discourse.julialang.org/t/ann-symbolicutils-jl-groundwork-for-a-symbolic-ecosystem-in-julia/38455 https://discourse.julialang.org/t/ann-symbolicutils-jl-groun... He took Sussman's course and became interested in the field from that! Great work.
- da39a3ee 6y agoWhenever SICM comes up here on HN it receives a lot of admiration. One thought that a lot of people have is whether there would be advantages in trying to do something like that in a statically typed language. Have you thought about types and SICMUtils?
- sritchie 6y agoHey, I have... I'm a co-author of Algebird[0], which has many ideas that I'd pull over. I'm hoping to introduce Clojure's "spec" or "schema" libraries so that the types at play can at least be inspectable inside the system. In a fully typed language, I'd implement the extensible generics as typeclasses. I suspect it would make it quite a bit tougher (at least in the approach I'm imagining) for folks to write new generic functions, due to many type constructors... On the other hand, the complexity is there, even if you don't write it down! It would be a big project, and a worthy effort, to write down types for everything in SICM. [0] https://github.com/twitter/algebird https://github.com/twitter/algebird
- kloimhardt 6y agoI made a scratch like visual programming system for sicmutils, clj-tiles[0]. Types are inspectable by right-clicking->Inspect on a specific block. Clj-tiles uses Clojure spec under the hood. One note: I am not sure whether a static type system can improve on this for someone who wants to learn Physics. After all, the types of function parameters change during the running program, as the same functions are called several times. But see for yourself: [0] https://kloimhardt.github.io/cljtiles.html?page=pendulumfinal https://kloimhardt.github.io/cljtiles.html?page=pendulumfina...