• 0 Posts
  • 4 Comments
Joined 11 months ago
cake
Cake day: October 18th, 2023

help-circle
  • I think the “Tools for going from the basic special forms into a full Lisp” are usually called “standard library”. Most if not all Lisps have them, and usually the standard libraries are written in Lisp, i.e. in the (simpler) Lisp that is implemented by the core.

    I don’t think there are any “bring your own bootstrap” Lisp implementations that you will be able to use 100% unchanged. Since different Lisps will have different sets of basic special forms/ promitives the various standard libraries are not drop-in interchangeable, but there’s a lot of overlap. E.g. the function list-length of my own Lisp is almost identical to the code from CLtL2.

    I’d say write your own standard library for your Lisp, taking inspiration from others such as Lisp500 or maybe even my own Lisp’s default library.

    Or skip the “write your own Lisp” part and integrate one of the embeddable Lisps into your platform.



  • At least with abcl you may want to consider using the builtin compiler for a considerable speedup, don’t know about the others:

    C:\>abcl
    CL-USER(1): (defun fib (x) (if (< x 2) 1 (+ (fib (- x 2)) (fib (- x 1)))))
    FIB
    CL-USER(2): (time (fib 39))
    86.97 seconds real time
    0 cons cells
    102334155
    CL-USER(3): (compile 'fib)
    FIB
    NIL
    NIL
    CL-USER(4): (time (fib 39))
    8.958 seconds real time
    0 cons cells
    102334155
    CL-USER(5):