On and off, I am teaching Symbolic Computation. Here are some notes, for my current students, and for my future self, about installing and using some CAS (and related systems) that have a free license (I will not use un-free software in teaching).
A typed CAS. Descendant of Scratchpad (1971), via Axiom (see http://axiom-developer.org/)
configure && make && make install
)fricas -rl
(the GNU readline wrapper. un-usable without)draw(surface(x*y,x+y,x^2+y^2),x=-1..1,y=-1..1)
Ctrl-D
quits, but it is )q
Descendant of Macsyma (1960s)
rlwrap maxima
(again, un-usable without readline)diff((1+x)^3,x);
(needs the semi-colon)Not CAS but for geometric constructions. Each drawing is in fact a straight-line program of Euclidean operations, and it will be re-executed after moving initial points. This is great for visualizing theorems about locations, and it motivates the study of polynomial ideals to prove them.
Home page http://geonext.uni-bayreuth.de/, but this currently (2021-04-05) gives a Typo3 error. Most recent working version https://web.archive.org/web/20200202230951/http://geonext.uni-bayreuth.de/index.php?id=2277.
Installation and usage:
wget https://web.archive.org/web/20200202230951/http://geonext.uni-bayreuth.de/data/download/1.74/geonext.1.74.zip
unzip -d geonext.1.74 geonext.1.74.zip
cd geonext.1.74
unzip -d geonext geonext.jar
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.282.b08-4.fc34.x86_64/jre/bin/java -cp geonext geonext.Geonext
Remarks:
unzip -d
: see remarks at http://www.linfo.org/tarbomb.htmlFor building from source (that’s the point of free software), we sometimes need several languages (compilers). In particular, CAS are often built on LISP, the first language of symbolic computation. Maxima and Fricas can be built with http://www.sbcl.org/.
The work of bootstrapping can be reduced by installing binaries instead - and sometimes that’s the only way (e.g., we need a LISP compiler to build SBCL LISP, and a Haskell compiler to build GHC, see below). Look first for packages in your OS’s distribution. Check other providers extra carefully, and definitely don’t curl ... | sudo bash
.
But it’s only in a container/VM you say? Well, then you’re wasting space (the VMs duplicates packages that you already have) and it’s an extra security risk: your distribution’s packages will get security updates but their copies won’t.
One might say that Haskell is a typed LISP. Well, ML (that’s “meta language”, not some abbreviation-du-jour) is typed LISP, and Haskell is lazy ML.
Bootstrapping is interesting since GHC, cabal, stack are written in Haskell; and cabal and stack already need lots of packages for building.
If you’re reasonably paranoid, start from some binary GHC download, and then bootstrap from source: first ghc
, then cabal
, then stack
.
These tools appear eager to phone home, and to drop binaries on you, so put this in your $HOME/.cabal/config
:
remote-build-reporting: none
and this in your $HOME/.stack/config.yaml
:
system-ghc: true
install-ghc: false
If you’re fully paranoid, or have an interest in retro-computing: there is a Haskell compiler written in C (https://archive.org/details/haskell-b-compiler), and a Haskell interpreter written in C (https://www.haskell.org/hugs/). It might be possible to bootstrap a current GHC from that. For (dis)trusting a bootstrapping compiler, see Ken Thompson’s 1984 Turing Award lecture https://dl.acm.org/doi/10.1145/358198.358210. For proving the correctness of a C compiler: https://compcert.org/.