Yes, the system you are describing now exists on Clojure! This is none other than Jerry Sussman's companion system for his book Wisdom - SICM (Structure and Interpretation of Classical Mechanics). For Clojure, it was called sicmutils and ported by Colin Smith.
I briefly described it elsewhere - fooobar.com/questions/394107 / ... - but briefly yes, it definitely does the four things that the F # article mentions, namely:
- Differentiation:
- Simplification of algebraic expressions
- Formatting
- Expression Analysis
and many many others...
1) Differentiation (full partial differentiation is supported)
> (defn ff [xy] (* (expt x 3)(expt y 5))) > ((D ff) 'x 'y) ==> (down (* 3 (expt x 2) (expt y 5)) (* 5 (expt x 3) (expt y 4))) > ;; ie vector of results wrt to both variables
NB. Two types of vectors are supported: up and down to accommodate covariant and contravariant expressions
2) Simplification of expressions: Oh, yes ...
> (def unity (+ (square sin) (square cos))) > (unity 'x) ==> 1 ;; yes we can deal with symbols
3) Formatting. Expressions can be made in TeX for a beautiful display. I can't show it easily here, but a Maple-style laptop / workhhet is being developed using Clojure "Gorilla"
4) Analysis: Obviously. The conversion between expressions and functions is an essential part of the system.
Take a look at https://github.com/littleredcomputer/sicmutils . you don’t even need Clojure to run it, you can use the jar file provided by Java.
source share