Minimalistic LISP implementation


It all stared when I discovered the "Campus LIsP" by Hirotsugu Kakugawa.
This brillant piece of code is a C implementation of a subset of the LISP language (no support for "properties" and strings) able to run on very small systems.
The core trick is a hack in the numerig format, carving out the space for the data type TAG, thus saving data space.


I improved the Campus LIsP language (Lemon version) enough to support iterative loops (by adding a WHILE statement) and published in the Z88DK project "examples" section: now it can be run on more than 30 Z80 based targets !
I studied LISP a bit and got few non-optimal but working library functions, including "SUBLIS", "MAP" and "REDUCE". This is enough to run a simplified version of the famous ELIZA conversational program; here is an example on my favourite port for the ZX81.


Things were getting interesting.. I understood a bit more the LISP power and its limits. A relevant one is the memory consumption and balancing it.
Another serious problem is connected to the long lasting LISP history: many researchers worked on this language basics so it changed over the time and it is easy to meet compatibility issues.
As an exercise i ported the LISP code I wrote for the Campus LIsP to the ZX Spectrum and Grundy NewBrain LISP implementation by "Serious Software".

It turned out to be a bit fragile but powerful implementation of a quite ancient LISP dialect (e.g. there are many similarities to the LISP 1.5 documentation published by MIT in 1964) !


By the way, this is the resulting port of the library and of ELIZA program.