shithub: femtolisp

branches: main


clone: git:// gits://
push: hjgit://
patches to: sigrid on 9gridchan, or

Last commit

ee58f398 – Sigrid Solveig Haflínudóttir <> authored on 2024/06/18 19:36
make {} synonyms to (), in addition to []


# femtolisp

A compact interpreter for a minimal lisp/scheme dialect.

This is a reanimation of with bigger plans.

Supported OS: [9front](, OpenBSD, Linux.

Supported CPUs: any decent 32-bit or 64-bit CPU, either LE or BE.

Tested on: 9front-latest/arm64, OpenBSD-current/amd64, Debian/ppc, Alpine/amd64, Android-termux/arm64, Debian/sparc64.

Some of the changes from the original include:

 * aggressive clean up and removal (like Windows and Mac OS X support)
 * `[` and `]`, `{` and `}` are synonyms to `(` and `)`
 * some of the previously available (but not merged) patches from the community and [Julia]( are applied
 * "boot" image is built into the executable
 * vm opcode definitions and tables are generated from a single file
 * fixed bootstrap (makes it work properly when opcodes change)
 * bigints

## Characteristics

  * lexical scope, lisp-1
  * unrestricted macros
  * case-sensitive
  * simple compacting copying garbage collector
  * Scheme-style varargs (dotted formal argument lists)
  * "human-readable" bytecode with self-hosted compiler
  * circular structure can be printed and read
  * `#.` read macro for eval-when-read and readably printing builtins
  * read macros for backquote
  * symbol character-escaping printer
  * exceptions
  * gensyms (can be usefully read back in, too)
  * `#| multiline comments |#`, `#;(block comment...`, lots of other lexical syntax
  * generic compare function, cyclic equal
  * cvalues system providing C data types and a C FFI
  * constructor notation for nicely printing arbitrary values