Axiom/FriCAS Interpreter

This is an experiment to see how much of the FriCAS interpreter that I can write using SPAD code. Currently the interpreter is written in 'boot' code. For example in int-top.boot, server.boot, i-toplev.boot i-syscmd.boot and many others.

I have started to try to document these structures on the page here.

Attempt to convert SPAD and Boot to other languages


Boot code is poorly documented and loosely typed. There would be lots of advantages if boot code were removed. I would like to be able to modify the interpreter so that I could have a chance to implement the features that I would like (see wishlist here). Modifying the existing interpreter is not practical for me, I don't have any experience with boot/Lisp code and any changes are likely to have unpredictable consequences, even for those who are experienced with the code. I may have a better chance with more strongly typed, higher level and better documented SPAD code.


The interpreter is a continuously running loop which I have called the 'main loop'. Each cycle of the loop goes through the stages on the right:

So far I have started working on the following, which is discussed on these pages:

The plan is to gradually implement more of these functions in high level code.

block diagram

Using The Code

Currently I am testing this out by running my interpreter loop inside the existing compiler loop. This makes it easier to work on and debug, it means that I don't have to recompile everything ever time I make some changes. At some stage in the future, if my experiments go well, I will need to compile this in as the main interpreter loop.

The code I have written to experiment with these things is on github here. Currently it just outputs diagnostic information to help me debug it.

To try the code download 'Interpret.spad' and 'types.spad' from github and compile it like this:

Note: we need to compile first in 'bootStrapMode' and then again normally, this is because the code has circular references.

Now we have compiled it we can run it as described on the Main Loop page

)boot $bootStrapMode := true
)co axiom/interpret/types
)boot $bootStrapMode := false
)co axiom/interpret/types
)co axiom/interpret/Interpret

Next Step

Look at these pages to see how the various components work and to try them out:

The Main Loop page has more information about how to try the code.

metadata block
see also:
  • My attempt to document existing interpreter structures on the page here.
  • My code on github
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.