gitmyhub

mal

Assembly ★ 11k updated 8mo ago

mal - Make a Lisp

A guided project for learning how programming languages work by building a Lisp interpreter from scratch in 11 incremental steps, available in 89 languages so you can compare the same concepts across Python, Rust, Bash, and more.

PythonJavaScriptRustJavaBashAssemblysetup: moderatecomplexity 3/5

Mal, which stands for Make a Lisp, is a project designed to teach people how programming languages work by having them build one. Specifically, it guides you through creating an interpreter for a dialect of Lisp, a family of programming languages with a long history in computer science. Lisp is known for its simple, highly regular syntax, which makes it an ideal subject for a language-building exercise.

The project breaks the work into 11 incremental steps, each self-contained and testable. You start with a basic read-evaluate-print loop (a shell that accepts input and shows output), then gradually add evaluation, variables, functions, error handling, file loading, macros, and more. The final step results in an interpreter that can run mal written in mal itself, which is called self-hosting. This is a meaningful milestone in language design.

What makes this project unusual is the breadth of languages it has been implemented in. The repository contains 89 different language implementations, covering everything from common choices like Python, JavaScript, Java, and Rust, to unusual ones like Bash, GNU Make, PostScript, PL/pgSQL (a database query language), LaTeX3, and NASM assembly. Each implementation follows the same 11-step structure, so you can compare how the same concepts look across very different languages.

For anyone learning about interpreters, compilers, or how programming languages actually work under the hood, mal serves as a structured guided project rather than just a finished piece of software. A detailed process guide walks through each step with explanations and architectural diagrams. There is also a Discord community for people building or studying implementations.

The README is primarily a reference index listing all implementations and their contributors. The full README is longer than what was shown.

Where it fits