1,029 karma · joined June 2, 2011
Blog: https://samritchie.io
[ my public key: https://keybase.io/sritchie; my proof: https://keybase.io/sritchie/sigs/_TS462cmjfImFbiWim_Fn5sGsIBqvrf20BpHEYUnNt0 ]
I really leaned in to these essay-style namespaces for this project; I spent _so_ much time deciphering old numerical algorithms ported from uncommented FORTRAN, and decided that I had to go the other direction.
Someday I'll get around to publishing a static site that renders the math in the comments, like these:
- https://samritchie.io/functional-numerical-methods (numerical integration written in stateless functional style) - https://samritchie.io/dual-numbers-and-automatic-differentia... (automatic differentiation that works on higher order functions etc)
Send me some of your (public) code to read!
https://github.com/mentat-collective/emmy/blob/main/src/emmy...
I discovered while writing this that I could express each of these algorithms as folds that consumed a stream of points, accumulating a progressively higher order polynomial.
Here's the same sort of thing but for rational function interpolation: https://github.com/mentat-collective/emmy/blob/main/src/emmy...
This goes for the schools too! There are "accredited Montessori schools", but any school can call itself Montessori with no penalty.
Not true in reality (speaking as a dad), and there's no way to read this other than as a joke example of a decision tree. Almost an advertisement for how decision trees can fail to capture any truly meaningful turning points of a big decision!
Same observations seems right for many other types of relationships. Time and attention is a gift, don't ruin it with ego.
Here's the org-mode export of the file, with all TeX rendered: https://samritchie.io/dual-numbers-and-automatic-differentia...
I worked on this with Gerald Sussman, and it has the somewhat unique feature of being able to take derivatives of higher-order functions. The system is also extensible, so this feature could have been installed outside of the core library, and in fact would need to be to support, say, functions that returns JS futures, scala functions etc.
Enjoy!
The library works in the browser as well, so interactive TeX rendering from Clojure symbolic expressions and functions is available at the quickstart page here: https://nextjournal.com/try/samritchie/sicmutils
- Smalltalk-ish things like writing suites of custom viewers for various types, - demos and examples in-line inside of a library - multiple stories about the same piece of code, but all with the ability to IMPORT the story as a library
I've been writing sicmutils[0] as a "literate library"; see the automatic differentiation implementation as an example[1].
A talk I gave yesterday at ELS[2] demos a much more powerful host that uses Nextjournal's Clerk[3] to power physics animations, TeX rendering etc, but all derived from a piece of Clojure source that you can pull in as a library, ignoring all of these presentation effects.
Code should perform itself, and it would be great if when people thought "LP" they imagined the full range of media through which that performance could happen.
[0] sicmutils: https://github.com/sicmutils/sicmutils
[1] autodiff namespace: https://github.com/sicmutils/sicmutils/blob/main/src/sicmuti...
[2] Talk code: https://github.com/sritchie/programming-2022
[3] Clerk: https://github.com/nextjournal/clerk
The library works in both JS and the JVM, so I was able to generate an unevaluated code form for the equations of motion (simplified, optimized!), which clerk sends over the wire for the JS build of sicmutils to run.
Here is the code for that demo: https://github.com/sritchie/programming-2022/blob/main/src/p...
The api is settling, of course this, so this current version is all quite playful! I will add instructions on how to get this building when I’m back at the keyboard.
Another way this will all get more powerful is via the in-progress mathbox-react[0] project. When that’s settled we can send a data structure representing a full scene across the wire, and build stuff like math3d[1] , but with the full power of Clojure augmenting the UI equation editor. Dreamy stuff!
I’m around and happy to answer any questions about the library, future plans, etc.
Mass changes spacetime curvature, and spacetime curvature pushes masses around, back and forth in a grand dance!
Works on the web too, which is a big boost for sharing work.
The Clojure port is quite fast, faster than the original for all benchmarks GJS has sent me, and more fleshed out. (That will change, as I've been pushing bugfixes and performance improvements back upstream as I go, as a meager gift to GJS for making this huge, amazing library in the first place.)
I actually wrote to GJS this morning asking for instructions on how to compile the original "scmutils", since I have the same problem. He responded saying he'll get back to me this afternoon, so I'll post here once I have details.
If you are still interested in getting the books going with MIT-Scheme, I put a decent amount of work into the exercises using the original codebase here[2], including a dockerized version of mit-scheme[3] and the scmutils package[4] that might be useful.
- [0] https://github.com/sicmutils/sicmutils/tree/main/test/sicmut...
- [1] https://nextjournal.com/try/samritchie/sicmutils/
- [2] https://github.com/sicmutils/sicm-exercises
I am SO HAPPY to see this work! Major timesaver for me and anyone looking to run the executable versions of Functional Differential Geometry[1] and Structure and Interpretation of Classical Mechanics[2] in the original language.
[0] https://github.com/sicmutils/sicmutils [1] https://github.com/sicmutils/fdg-book [2] https://github.com/sicmutils/sicm-book
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.
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
Many more exercises live here: https://nextjournal.com/sicm/