Skip to content

cl-cc

cl-cc is a self-hosting Common Lisp compiler and runtime written in pure Common Lisp. It compiles ANSI Common Lisp to a register-based bytecode VM, and from there to native x86-64, AArch64, and WebAssembly. PHP and JavaScript frontends lower to the same AST and reuse the whole backend.

There is no project C source. The VM interpreter includes a minimal SBCL host-backed CFFI-compatible FFI shim.

The compiler's core design — CLOS dispatch, Prolog-based optimization, CPS transformation, Hindley–Milner type inference — is implemented using the same language features it compiles.

(defstruct point (x 0) (y 0))

(let ((p (make-point :x 3 :y 4)))
  (+ (point-x p) (point-y p)))
;; => 7

Where to go next

  • Getting started — install cl-cc, run your first program, and build the compiler from source.
  • Core concepts — which parts of ANSI Common Lisp the compiler implements, with examples.
  • Recipes — the REPL, the PHP frontend, and the JavaScript frontend.
  • CLI — every command and flag.
  • Architecture — the compiler pipeline, the package layout, and how self-hosting works.
  • Compatibility — ANSI conformance status, known limitations, and the security scope.

Project

cl-cc is MIT licensed and developed at nerima-lisp/cl-cc.

Contribution guidelines, the code of conduct, and support channels are org-wide and live in the nerima-lisp/.github repository. Report security vulnerabilities privately through GitHub Security Advisories; see Compatibility for what counts as in scope.