First of all: Thank you for sharing the link to this great Lisp interpreter!
I had lots of fun during the last hour to type all kind of Lisp-nonsense into the input field and it survived all my attemts to crash the interpreter pretty well so far.
I think ATOMs, CONS cells, LISTs, and math functions (everything that has to do with numbers) are most important, and I see that you have already implemented most of them.
The third-useful thing after DEFUN and SETF would be DEFMACRO and everything that has to do with manipulating symbols like SYMBOL-NAME, SYMBOL-VALUE, SYMBOL-FUNCTION, SYMBOL-PLIST, etc.
Next-useful things were CHARACTERs and SEQUENCEs like STRINGs, VECTORs (where strings are vectors of characters), and ARRAYs (which also could be implemented on the Lisp user level as vectors of vectors).
Is the goal to be compatible with AutoLisp, Common Lisp, or both? I see function names like FAC and FIB that are no Common Lisp functions.
Do you know Tom Almy's XLISP-PLUS
interpreter? It's an subset of Common Lisp with a Smalltalk-like object system (message passing instead of generic functions). The source code is available under:
It's written in C (not C++), but maybe it's useful fo looking-up how things are implemented?
The XLISP interpreter originally was written by David Betz, but Tom Almy got official permission to continue and maintain the old XLISP Lisp interpreter, while David Betz rewrote and maintains the same thing now as a XLISP Scheme interpreter
(what is probably not what you want).
Practical problem while playing with your interpreter - how long does it take to compute:
- Code: Select all
(expt 333333 444444)
I have waited approx. half an hour without any result, afterwards the website was "frozen", I couldn't even move my web browser's scrollbar anymore. But re-loading the page (what fortunately still worked) made the Remote-Lisp entry field work again. I hope I haven't damaged your program.