Resources and frameworks for designing custom programming languages, compilers, virtual machines, and runtime interpreter environments.
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.
This repository provides a comprehensive, step-by-step guide to building a complete programming language, covering essential components like lexers, parsers, abstract syntax trees, and custom bytecode virtual machines.
The project is a modular compiler infrastructure framework designed for building programming language toolchains, frontends, and backends. It provides a comprehensive suite of reusable libraries and tools that enable developers to transform source code into efficient native executables across diverse hardware architectures and operating systems. At its core, the system utilizes a language-agnostic intermediate representation bitcode, which serves as a unified format for code analysis, optimization, and machine-specific code generation. What distinguishes this framework is its highly decoupled compiler pipeline and declarative approach to backend development. By using table-driven definitions, developers can automatically generate instruction selectors and register allocators for new architectures. The system also integrates a just-in-time execution engine for on-the-fly compilation and a link-time optimization framework that performs cross-module analysis to improve global program performance. These capabilities are complemented by a high-performance linker that supports architecture-specific code layout and can be embedded directly into applications. The project covers a broad capability surface, including support for compiling C-family languages, implementing standard libraries, and maintaining conformance to language specifications. It provides extensive diagnostic utilities for software performance analysis, memory error detection, and binary inspection. The infrastructure also includes cross-platform build abstractions to ensure consistent compilation across different environments.
This is the industry-standard compiler infrastructure that provides the essential backend, intermediate representation, and optimization framework required to build high-performance programming languages.
Boa is a high-performance JavaScript engine and parser designed to execute JavaScript code and analyze source code structure. It functions as a runtime environment for executing scripts to automate tasks or process data, providing both a command-line JavaScript interpreter and a tool for converting source code into abstract syntax trees. The engine is capable of compiling to WebAssembly, allowing the runtime to be deployed and executed within web browser environments. It includes an interactive read-eval-print loop for real-time logic testing and snippet execution via a terminal. The system covers comprehensive syntax analysis and script execution, including the ability to export parsed code structures for structural analysis and debugging.
Boa provides a robust parser, abstract syntax tree generator, and bytecode virtual machine, serving as a practical implementation of language development components that you can study or integrate into your own language projects.
Ohm is a formal grammar parser generator and domain-specific language framework. It provides a system for defining custom languages to parse, validate, and extract data from input text, transforming raw strings into hierarchical abstract syntax trees based on specified formal rules. The project utilizes an Earley parsing algorithm, which allows it to support all context-free grammars, including those with left recursion and ambiguity, without requiring predefined operator precedence. It also includes a dedicated debugging toolkit for tracing and visualizing the step-by-step state transitions and rule applications the parser makes when processing input. The framework covers language definition, input string validation, and semantic value extraction from parsed structures.
Ohm is a formal grammar parser generator that provides the essential infrastructure for defining language syntax and generating abstract syntax trees, making it a core tool for building custom languages.
Tree-sitter is a parsing system and incremental parsing framework designed to generate high-performance syntax trees from source code. It functions as a language parsing engine that compiles formal grammar definitions into portable code, which can then be integrated into text editors and development tools to facilitate structural analysis, code navigation, and syntax highlighting. The project distinguishes itself through its ability to maintain valid, usable syntax tree structures even when source code contains syntax errors or incomplete fragments. It utilizes a generalized parsing algorithm to handle ambiguous grammars and employs an incremental update mechanism that re-parses only the modified portions of a file, ensuring responsiveness during active editing sessions. Beyond its core parsing capabilities, the system includes a declarative query engine that allows users to execute pattern-matching searches against generated syntax trees. This enables the extraction of specific nodes or structural information for complex analysis and transformation tasks. The framework provides a language-agnostic runtime core and native bindings, allowing developers to embed these parsing and querying capabilities into a wide variety of host applications.
This is a specialized parsing system and incremental parsing framework that provides the essential parser generation and syntax tree construction capabilities required for building custom programming languages.
HHVM is a high-performance execution engine and runtime environment designed for the Hack language. It functions as a persistent web application server that processes incoming network traffic, while also providing command-line utilities for executing standalone scripts and performing automated tasks. The project distinguishes itself through a sophisticated execution model that utilizes just-in-time compilation to translate bytecode into optimized machine code. This process is supported by a static type analysis engine that enforces strict data constraints and identifies type inconsistencies before code execution. By leveraging profile-guided optimization and multi-threaded request handling, the runtime continuously refines its performance based on actual usage patterns and concurrent traffic demands. Beyond its core execution capabilities, the platform includes comprehensive tools for type safety validation and environment configuration. Users can adjust internal execution parameters and resource limits through external files, allowing for customized behavior without modifying the underlying application source code.
This is a high-performance runtime and execution engine for the Hack language rather than a toolkit or framework designed to help you build your own custom programming language.