Skip to content

sdiehl/compiler-crates

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Compiler Crates

CI

A collection of minimal Rust examples focused on compiler development.

Parsing & Lexing

  • chumsky | docs - Parser combinator library with excellent error recovery
  • combine | docs - Parser combinators with zero-copy mode for performance
  • lalrpop | docs - LR(1) parser generator with powerful grammar syntax
  • logos | docs - Fast, derive-based lexer generation
  • nom | docs - High-performance parser combinators for binary and text formats
  • peg | docs - Parsing expression grammar with inline syntax
  • pest | docs - PEG parser generator with elegant grammar files
  • rowan | docs - Lossless syntax trees with incremental reparsing
  • rust_sitter | docs - Tree-sitter grammar generation through Rust macros
  • rustc_lexer | docs - The actual lexer used by the Rust compiler
  • winnow | docs - Parser combinators with a focus on maintainability

Parser Utilities

  • nom_locate | docs - Location tracking for nom parsers
  • quote | docs - Quasi-quoting for Rust code generation
  • syn | docs - Rust syntax tree parsing and manipulation for procedural macros

Diagnostics

  • ariadne | docs - Modern diagnostic reporting with emphasis on clarity
  • codespan-reporting | docs - Beautiful compiler error messages with source snippets
  • miette | docs - Comprehensive diagnostic framework with derive macros

Data Structures

  • bitflags | docs - Type-safe bitmask flags for compiler IR and AST nodes
  • bumpalo | docs - Fast bump allocation arena for compiler data structures
  • id-arena | docs - Efficient arena allocation for AST and IR nodes
  • indexmap | docs - Order-preserving hash maps for symbol tables
  • smallvec | docs - Stack-allocated vectors for performance-critical paths
  • symbol_table | docs - String interning for compiler symbols

Analysis & Algorithms

  • petgraph | docs - Graph algorithms for control flow and dependency analysis

Code Generation

  • cranelift | docs - Fast JIT code generator for WebAssembly and language runtimes
  • dynasm | docs - Runtime assembler for ARM64 and x86-64 with compile-time syntax checking
  • inkwell | docs - Safe LLVM bindings for generating optimized machine code
  • melior | docs - MLIR bindings for multi-level IR compilation

Development Tools

  • codespan | docs - Core span tracking and position management for compilers
  • rustyline | docs - Line editing for REPL implementations

Build Commands

just build       # Build all crates
just test        # Run all tests
just lint        # Run clippy on all crates
just format      # Format all code
just build-docs  # Build documentation
just serve-docs  # Serve documentation locally

License

MIT Licensed. Copyright 2025 Stephen Diehl.

About

Minimal examples of crates useful for compiler development

Topics

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •