11fd8f6 vm: apply_cl: remove most of the function-local variables - prefer op-local ones instead
~ft pushed to ~ft/femtolisp git
A compact interpreter for a minimal lisp/scheme dialect.
This is a reanimation of https://github.com/lambdaconservatory/femtolisp with bigger plans.
Supported OS: 9front, Unix-like operating systems (OpenBSD, NetBSD, Linux, etc).
Supported CPUs: any decent 32 or 64-bit, little or big endian.
Tested on: 9front/arm64, OpenBSD/386, NetBSD/sparc64, Alpine/amd64, Android/arm64.
Also runs on: MacOS 4.x-9.x, Mac OS X, Haiku, DOS.
Some of the changes from the original include:
[
and ]
, {
and }
are synonyms to (
and )
define
→ def
, define-macro
→ defmacro
λ
as a shorthand for lambda
t
/T
instead of #t
/#T
and nil
instead of #f
(def (f ...) "Docs here" ...)
and (help ...)
blah#
) at read time(void)
and void?
c***r
of empty list returns empty listTwo ways to learn about more changes:
meson setup build -Dbuildtype=release
ninja -C build test
mk all test
Clone and build Retro68. This fork grabs the necessary patches for more things to work as expected:
git clone https://git.sr.ht/~ft/retro68
mkdir retro68-build
cd retro68-build
../retro68/build-toolchain.bash --ninja
# wait until everything builds, make sure it did not error out
Now build femtolisp:
cd femtolisp
export PATH="$PATH:$(pwd)/../retro68-build/toolchain/bin"
# for PowerPC:
meson setup build . -Dbuildtype=minsize --cross-file cross/powerpc-apple.txt
# for m68k:
meson setup build . -Dbuildtype=minsize --cross-file cross/m68k-apple.txt
ninja -C build
Either build/flisp.dsk
or build/flisp.bin
is the file to get on your Mac.
NOTE: this isn't a full-fledged port and is going to stay low priority unless somebody wants to spend time polishing it.
Build DJGPP cross-compiler, then:
export PATH=$PATH:path-to-djgpp-toolchain/bin
meson setup build . -Dbuildtype=minsize --cross-file cross/djgpp.txt
ninja -C build
Result is build/flisp.exe
.
#.
read macro for eval-when-read and readably printing builtins#| multiline comments |#
, #;(block comment...
, lots of other lexical syntax