Skip to content

sw-embed/sw-cor24-macrolisp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

150 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sw-cor24-macrolisp

Tiny Macro Lisp for COR24 — a minimal Lisp-1 with lexical scope, unhygienic defmacro, closures, mark-sweep GC, and tail-call optimization. Compiles to COR24 24-bit RISC assembly.

Forked from sw-vibe-coding/tml24c as part of the COR24 ecosystem consolidation.

Built on:

Quick Start

just build       # compile
just test        # run test suite
just run         # interactive REPL (Ctrl-] to exit)
just eval <file> # evaluate a .l24 file

Language

  • Types: fixnums, symbols, cons pairs, strings, closures, macros, primitives
  • Special forms: quote, if, define, set!, lambda, defmacro, begin, quasiquote
  • Standard prelude: 60+ functions and macros including map, filter, reduce, let, cond, and, or, ->, ->>, lazy sequences, anaphoric macros, and more
  • Tail-call optimization: if, begin, and closure application
  • Conservative GC: scans C stack for heap pointers — no manual root management
  • Multi-line REPL: paren-depth tracking across newlines
  • I/O: peek/poke for memory-mapped hardware, display for UART output

Demos

See docs/demos.md for the full list. Highlights:

just demo-bottles   # 99 Bottles of Beer (macro + tail recursion)
just demo-bottles2  # 99 Bottles (trampoline mutual recursion)
just eval demos/lazy.l24       # infinite sequences
just eval demos/anaphora.l24   # anaphoric macros (aif, awhen)
just eval demos/threading.l24  # -> and ->> pipelines
just eval demos/mutation.l24   # set!, counters, memoization

Documentation

Document Description
demos.md Demo descriptions and commands
porting-clojure.md Clojure-to-tml24c feature mapping and translation guide
true-and-nil-patterns.md Truth, nil, and boolean conventions
prelude-choices.md Prelude tiers (tiny/standard/full/experimental)
plan.md Implementation plan and future roadmap
bugs.md Known issues

Links

Copyright

Copyright (c) 2026 Michael A. Wright

License

MIT -- see LICENSE for details.

About

Tiny Macro Lisp for COR24 — Lisp-1 with closures, GC, and TCO (fork of tml24c)

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors