# munificent/craftinginterpreters

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/munificent-craftinginterpreters).**

10,539 stars · 1,244 forks · HTML · other

## Links

- GitHub: https://github.com/munificent/craftinginterpreters
- Homepage: http://www.craftinginterpreters.com/
- awesome-repositories: https://awesome-repositories.com/repository/munificent-craftinginterpreters.md

## Topics

`book` `bytecode` `c` `compiler` `interpreter` `java` `language` `lox` `markdown` `parser` `scripting-language`

## Description

Crafting Interpreters is a comprehensive resource for building a complete programming language from scratch. It provides a structured guide to the fundamental components of language implementation, including lexing, parsing, and the design of execution engines.

The project demonstrates two distinct approaches to language execution: a tree-walking interpreter that evaluates source code by traversing its abstract syntax structure, and a stack-based virtual machine that compiles code into custom bytecode for execution. These implementations are supported by core runtime mechanisms such as lexical scoping environments and automated memory management systems.

The guide covers the design of tracing garbage collectors and tagged union value representations to manage data and resources efficiently. It serves as a technical reference for developing language front-ends and custom virtual machines, detailing the processes required to transform source code into executable logic.

## Tags

### Education & Learning Resources

- [Language Implementation Guides](https://awesome-repositories.com/f/education-learning-resources/educational-resources/languages-and-programming-concepts/programming-language-mastery-guides/language-implementation-guides.md) — Offers a comprehensive resource for building a complete programming language from scratch.

### Programming Languages & Runtimes

- [Programming Language Architectures](https://awesome-repositories.com/f/programming-languages-runtimes/compiler-interpreter-internals/programming-language-architectures.md) — Provides a comprehensive guide to building custom programming languages from scratch.
- [Stack-Based Virtual Machines](https://awesome-repositories.com/f/programming-languages-runtimes/runtime-execution-environments/runtime-environments/runtimes/stack-based-virtual-machines.md) — Implements a high-performance execution engine that processes custom bytecode on a virtual stack.
- [Virtual Machines](https://awesome-repositories.com/f/programming-languages-runtimes/runtime-execution-environments/runtime-environments/execution-engines/virtual-machines.md) — Compiles source code into specialized instructions and runs them on a virtual machine. ([source](http://www.craftinginterpreters.com/contents.html))
- [Garbage Collectors](https://awesome-repositories.com/f/programming-languages-runtimes/runtime-execution-environments/runtime-environments/runtime-internals-foundations/garbage-collectors.md) — Provides a memory management mechanism that tracks object references during runtime to reclaim unused data.
- [Lexical Scoping Mechanisms](https://awesome-repositories.com/f/programming-languages-runtimes/runtime-execution-environments/runtime-environments/runtime-internals-foundations/runtime-architecture/lexical-scoping-mechanisms.md) — Implements nested symbol tables to manage variable visibility and lifetime within the language runtime.

### Software Engineering & Architecture

- [Tree-Walking Interpreters](https://awesome-repositories.com/f/software-engineering-architecture/abstract-syntax-tree-specifications/tree-walking-interpreters.md) — Evaluates source code by traversing the abstract syntax tree directly to execute logic.
- [Pedagogical Interpreters](https://awesome-repositories.com/f/software-engineering-architecture/abstract-syntax-tree-tools/pedagogical-interpreters.md) — Serves as a pedagogical implementation that evaluates source code by traversing its structural representation.
- [Abstract Syntax Tree Tools](https://awesome-repositories.com/f/software-engineering-architecture/abstract-syntax-tree-tools.md) — Provides utilities for programmatically parsing and traversing source code structures.

### DevOps & Infrastructure

- [Interpreted Runtimes](https://awesome-repositories.com/f/devops-infrastructure/execution-environments/code-execution-runtimes/interpreted-runtimes.md) — Executes source code directly by traversing its structure without a prior compilation step. ([source](http://www.craftinginterpreters.com/contents.html))

### Operating Systems & Systems Programming

- [Memory Management Systems](https://awesome-repositories.com/f/operating-systems-systems-programming/kernel-core-internals/process-and-memory-management/memory-management-systems.md) — Tracks object references during program execution to identify and remove unused data. ([source](http://www.craftinginterpreters.com/contents.html))
- [Garbage Collection](https://awesome-repositories.com/f/operating-systems-systems-programming/kernel-core-internals/process-and-memory-management/memory-management/automated-reclamation-systems/garbage-collection.md) — Identifies and reclaims unreachable memory by periodically scanning object references.

### Web Development

- [Single-Pass Compilers](https://awesome-repositories.com/f/web-development/performance-optimizations/component-update-optimizations/bytecode-compilers/single-pass-compilers.md) — Transforms source code into executable instructions in one traversal to minimize build overhead.
