Computer Algebra Programs

In order to work with the mathematics on this site it is useful to have a computer algebra program. It is possible to do numeric arithmetic, involving integers, floating point, complex numbers, vectors, quaternions, matrix and so on, in most programming languages. Most languages have mathematical libraries that that help with these sort of numeric calculations.

However, when we want to do more general computer algebra, involving symbolic values and more abstract algebra concepts, then things get a bit more complicated. We could either try to code these things using a mainstream computer language or use a CAS (Computer Algebra System) that is a language or program specifically designed for computer algebra. There does not seem to be an ideal solution here, each approach has disadvantages as well as advantages.

There are many good open source CAS programs but many of them are specific to certain types of mathematics. Since I wanted an open source program with capability across a wide range of mathematics then I narrowed the choice down to two options.

Both systems have their pros and cons but overall I like the power of the SPAD language which is designed specifically for mathematics and uses static typing as opposed to Pythons dynamic typing. The typing system in SPAD is very powerful in certain areas such as supporting 'dependant types' which most languages don't. However there are other aspects of the SPAD which is not as powerful as say Haskell. Also SPAD is very quirky, has a steep learning curve and the error messages and general infrastructure can be challenging.

For a wider discussion of computer projects for mathematics see this page.


These programs all derive from an experimental maths program by IBM. There are now various versions which can be confusing for new users.

I suggest potential new users try FriCAS first, since it seems to be the most actively developed version, see page here.

Axiom uses a language called 'SPAD' (a shortened form of the word 'Scratchpad') to allow users to define algebras. It comes with a big library of algebras which interwork with each other, users can add their own algebras to interwork with these. I have described SPAD on this page, axiom comes with both an SPAD compiler and an interpreter.

SPAD is built on top of the language 'Lisp'. The development environment for SPAD is minimal, programs are edited using any text editor and run form the command line. The error messages are often very unhelpful and frequently refer to the underlying Lisp code.

The learning curve for SPAD is very steep, many feature of the language such as the pattern matching used to dispatch functions can be difficult to understand and try to work out what function will be called. A mathematics program really needs to be more predictable than this. The type system does have its limitations, its not possible to represent category theory concepts such as monads in the way that languages like Haskell or Scala can.

Having said all this, SPADs tradeoff between dependant types and type safety is very powerful, I think the language deserves to be much more widely used if only some of these issues could be tackled. I have put my 'wish list' for improvements that I would like to the FriCAS program on the page here.

Axiom is a free (open source) general purpose computer algebra system. It has been in development since 1971 originally as Scratchpad by researchers at IBM under the direction of Richard Dimick Jenks. In the 1990s it was sold to NAG and given its current name. In 2001 it was withdrawn from the market and released to Tim Daly, the project lead developer, under the Modified BSD License. In 2007, Axiom was forked into two different open source projects: OpenAxiom, and FriCAS. The amount of developer activity seems very low at the moment and it is a pity that the developer effort and user resources are fragmented in this way.


I'll quote what Tim Daly wrote here: "In general, Axiom was created as a piece of research software used only by fellow researchers, usually to complete their thesis work. Thus, the algorithms are world class. But the documentation isn't."

Tims answer is 'Literate Programming' as explained here. Although many people would agree with its aims I don't think there is a lot of agreement in its methods. It seems to require an extra layer of non-standard tools for programmers and I don't think everyone wants to read programs+documentation in a linear manor like a book. In the case of Axiom the literate programming experiment seems not altogether successful (yet?), its hard to see how such a heavyweight methodology can fill in the gaps in so much undocumented code. The leaders of the forks of Axiom seem (how can I put this politely?) ambivalent, at best, to the whole topic of documentation, even for new code.

The result of all this is that documentation is incomplete, often out-of-date and fragmented. Potential users and programmers have to search in lots of places and this makes a steep learning curve worse.

At the moment documentation is spread between:

  Axiom FriCAS Aldor
Axiom Book see volume 0 below. in either PDF or html form  
Literate Programming

PDF files (also listed here):

Being removed or left as comments. Spread over about 400 files and it is not always clear which one might hold the information that is being sought.  
HyperDoc - from program Potentially a powerful idea, for example '++' comments are picked up by HyperDoc. But HyperDoc has an old fashioned interface, in a small window on the screen. Hard to write and hard to use. I gave up using because it often crashed (may be fixed now?)  
HyperDoc - external HTML Slowly being ported to xhtml here    
Main Web Site


NAG Docs

Web Axiom is being reworked to use a browser as its front end, and HyperDoc. FriCAS now has a documentation web page which includes an API, so much of HyperDoc‚Äôs material is available here.  
Wiki   FriCAS Wiki, formally known as Axiom Wiki.  
Mailing List axiom developer fricas-devel mailing list aldor dev
Online Documentation spread over various places on the web.

Much of this is out of date and confusing. It is very incomplete, even if you manage to search through all of this, chances are you wont find what you want?

Next Steps

In addition to the external documentation listed above I have tried to record here the information I find out. This comes with the same warning as the sources above, it can get out of date with time.

You may want to start on one of these pages:

metadata block
see also:
  • For a wider discussion of computer projects for mathematics see this page.
  • My 'wish list' for improvements to FriCAS.
Correspondence about this page

This site may have errors. Don't use for critical systems.

Copyright (c) 1998-2023 Martin John Baker - All rights reserved - privacy policy.