7 branches

README.md

funcl

funcl is a self-hosting Common Lisp implementation in active development. Its long-term goal is ANSI Common Lisp with low-pause concurrent GC and Go-style single-binary deployment: the implementation emits native ELF and PE/COFF directly instead of relying on ld, lld, link.exe, MinGW, libc, or a C runtime.

Today the repository is a bootstrap compiler, runtime, image builder, and growing CL subset for Linux x86-64, with PE/COFF support present in the emitter and smoke tests. The v1.0 product goals and release gates are tracked in PRD.md; architecture decisions live in docs/decisions/.

Current Status

funcl is pre-v1.0. It is self-hosted through an Emacs Lisp cold-start path:

  1. elisp/ builds build/funcl-stage1 from the canonical sources in src/.
  2. build/funcl-stage1 compiles those same sources into build/funcl-stage2.
  3. build/funcl-stage2 saves an image containing the prelude and mini-CLOS, then bakes it into the shipped build/funcl.

The fixed-point self-host and cold/warm split are covered by the bootstrap test suite.

Implemented

  • Direct ELF64 emission for Linux x86-64, including native code, runtime layout metadata, materialized constants, and no system linker.
  • PE32+ emission path and Windows OS-shim code, with host smoke tests; Windows is not yet the primary development target.
  • Self-hosted compiler sources under src/cold/, with the Emacs Lisp host kept as the permanent bootstrap path.
  • Warm overlay support for image save/load and the bootstrap REPL.
  • Embedded-image final binary: build/funcl runs with the prelude and mini-CLOS baked in, independent of the current working directory.
  • A moving GC implementation with dedicated fast and soak test targets.
  • A growing CL subset: tagged fixnums, bignums, ratios, conses, strings, simple vectors and arrays, hash-table basics, packages, macros, multiple values, conditions/restarts, a subset of CLOS, reader/printer support, file I/O, and runtime eval.

Still In Progress

  • Full ANSI conformance.
  • Production-grade Windows target support.
  • Full pathname, stream, debugger, FFI, thread, and fiber support.
  • Complete package semantics, CLOS method combination/multiple dispatch, and the remaining condition-system details.
  • Hardening of image relocation, canonical symbol/string interning, and precise runtime invariants tracked in the later ADRs.

The detailed backlog is intentionally not duplicated here. Use PRD.md, PRD-v1.1.md, PRD-v2.0.md, ERRORS.md, and the project issues for the live gap list.

Repository Layout

  • src/cold/ - self-hosted compiler, runtime, GC, ELF/PE emitters, loader, materializer, and cold bootstrap support.
  • src/warm/ - image and REPL overlay loaded above the cold compiler.
  • src/stdlib.lisp - prelude compiled into self-hosted outputs.
  • src/mini-clos.lisp - small CLOS layer baked into the final image.
  • elisp/ - Emacs Lisp bootstrap host and compatibility shims.
  • tests/ - ERT bootstrap tests, shell smoke tests, GC tests, and fixtures.
  • compat/alexandria/ - vendored compatibility subset used by tests and bootstrap work.
  • docs/decisions/ - architecture decision records.
  • host-sbcl-legacy/ - historical SBCL host, no longer used by Makefile targets.

Requirements

  • GNU Make
  • Emacs with cl-lib
  • A Linux x86-64 host for the main build/test path
  • Optional: Wine for PE smoke tests

No system linker is required for funcl-generated Linux binaries.

Build

make build

This produces:

  • build/funcl-stage1 - Emacs-built bootstrap compiler
  • build/funcl-stage2 - self-compiled compiler
  • build/funcl - self-contained image-bearing binary

Useful build-related targets:

make build/funcl-cold
make build/funcl-warm.fco
make build/funcl-warm-cold.fco
make elisp-bytecode
make elisp-bytecode-clean
make clean

make help prints the complete target list.

Run

Compile one expression through the Emacs bootstrap host, emit an ELF, and run it:

make elisp-compile EXPR='(let ((x 7)) (* x 6))'

Build the self-hosted binary, then run it:

make build
./build/funcl

Test

make test-bootstrap
make test-bootstrap-quiet
make test-fast
make test-fast-sharded
make test-smoke
make test-gc
make test-gc-soak
make bootstrap-stage1

For emitter, compiler, runtime, or image changes, run the full bootstrap suite before relying on the result:

make test-bootstrap

make test-fast and make test-fast-sharded are iteration aids; they skip the slow fixed-point, warm-bundle, CLOS bootstrap, cold-funcl, and float-heavy tests.

Version

make version

Current source version: 0.0.1.

License

GPL-2.0-only WITH Classpath-exception-2.0. See LICENSE.

Copyright (C) 2026 Anthony Green green@moxielogic.com.