HeadlinesBriefing favicon HeadlinesBriefing.com

Native Lisp-to-Assembly Compiler Targets Linux AMD64

Hacker News •
×

GitHub user skx/slisp released a Lisp-to-assembly compiler that targets Linux AMD64. The tool reads Lisp source, emits standalone ELF64 assembly, and links to a runnable binary. While Lisp is usually interactive, this compiler lets developers ship self‑contained executables, supporting functions, lambdas with closures, integers, strings, lists, and basic arithmetic.

The project bundles a small standard library written in its own language; unless the standard library flag is disabled, the compiler prepends these definitions to every program. Example code includes a factorial function and a Brainfuck interpreter, while a test suite under test/ validates output against known results. Build steps involve compiling to .snasm, assembling with -f elf64, then linking.

The compiler omits advanced features such as macros or no garbage collection, keeping the runtime footprint tiny but requiring manual memory management. Installation is a single `make` command, and a convenience target compiles any .lisp file in the current directory automatically. Overall, skx/slisp offers a practical way for Lisp enthusiasts to produce native Linux binaries without a VM.

The source includes Go unit tests and a five‑minute fuzz harness, proving the compiler’s correctness and encouraging further community contributions.