Langdev libraries for Rust
- Lexers
- Parsers
- Codegen
- String interning
- Just-in-time compilation
- Error reporting
- Language server protocol
- Testing
- Incremental compilation
- Floats/Ints/Bools
- Binary & object file parsing, generating and processing
- Solvers
- CLI
- Repl
- String handling
- Syntax trees
- Pretty printing
- Variable binding
- Caching
- WASM
- Logging
- Storage
- Incremental Analysis
- Fuzzing
- Graphs
- Type Checking
- Peephole Optimization
- Garbage Collection
- Guides & Resources
- Uncategorized
Lexers
logos
Logos has two goals: To make it easy to create a Lexer, so you can focus on more complex problems and to make the generated Lexer faster than anything you'd write by handlrlex
A replacement forlex
/flex
that generates Rust codelexgen
A fully-featured lexer generator, implemented as a proc macro.
Parsers
lalrpop
A convenient LR(1) parser generatornom
A byte-oriented, zero-copy, parser combinators librarycombine
Fast parser combinators on arbitrary streams with zero-copy support.pom
PEG parser combinators using operator overloading without macros.peg
A simple Parsing Expression Grammar (PEG) parser generator.glue
Glue is a parser combinator framework for parsing text based formats, it is easy to use and relatively fast toopratt
A general purpose pratt parser for Rustpest
A general purpose parser written in Rust with a focus on accessibility, correctness, and performance using parsing expression grammars (PEG)lrpar
A Yacc-compatible parser.nimbleparse_lsp
An LSP server for quickly developing lrpar parsers, which parses input buffers on grammar change bypassing code generation.
tree-sitter
A parser generator for building fast editor-friendly parsers with features like streaming, incremental, resumable (re)parsing, with timeouts and cancellations, and advanced syntax node queries.rowan
Generic lossless syntax treesungrammar
A DSL for specifying concrete syntax trees, see this introductory post
cstree
A fork ofrowan
with threadsafe syntax trees and built-in source string interningchomp
Chomp is a fast monadic-style parser combinator library designed to work on stable Rustoak
A typed parser generator embedded in Rust code for Parsing Expression Grammarschumsky
A friendly parser combinator crate that makes writing LL(k) parsers with error recovery easyrust-sitter
A package for defining tree-sitter grammars alongside Rust logic
Regular expressions
regex
An implementation of regular expressions for Rust. This implementation uses finite automata and guarantees linear time matching on all inputs.regress
A regular expression engine targeting EcmaScript syntax.onig
Rust-Onig is a set of Rust bindings for the Oniguruma regular expression library.
Codegen
cranelift
Cranelift is a low-level retargetable code generatorllvm-sys
Bindings to LLVM's C APIiced-x86
A blazing fast and correct x86/x64 disassembler, assembler and instruction decoderllama
Friendly LLVM bindingsinkwell
Inkwell aims to help you pen your own programming languages by safely wrapping llvm-sysllvm-ir
LLVM IR in natural Rust data structuresllvmenv
Manage multiple LLVM/Clang buildswalrus
A library for performing WebAssembly transformationscilk
Toy Compiler Infrastructure influenced by LLVM written in Rust.
String interning
lasso
A multithreaded and single threaded string interner with a minimal memory footprint and arena allocationstring-interner
A data structure to cache strings efficientlysimple-interner
A simple append-only internerstring_cache
A string interning library for Rust, developed as part of the Servo project
Just-in-time Compilation
iced-x86
A blazing fast and correct x86/x64 disassembler, assembler and instruction decodermasm-rs
A JSC/SpiderMonkey like macro assemblerb3
Rust port of B3, LLVM-like backendjit
(LibJIT) Just-In-Time Compilation in Rust using LibJIT bindingslightning-sys
GNU lightning bindings for rustgccjit
Higher-level Rust bindings for libgccjitcranelift
Cranelift is a low-level retargetable code generatorcranelift-jit-demo
A JIT compiler and runtime for a toy language, using Cranelift
dynasm
A Dynamic assembler written in Rust for Rust
Error reporting
codespan-reporting
Beautiful diagnostic reporting for text-based programming languagescodespan
Data structures for tracking locations in source codetext-size
A library that provides newtype wrappers foru32
and(u32, u32)
for use as text offsetsariadne
A fancy diagnostics & reporting cratemiette
Fancy diagnostic reporting library and protocol for us mere mortals who aren't compiler hackers
Language server protocol
lsp-types
Types for interaction with a language server, using VSCode's Language Server Protocoltower-lsp
Language Server Protocol implementation based on Towercodespan-lsp
Conversions between codespan types and Language Server Protocol typeslsp-server
A generic LSP server scaffold
Testing
goldentests
A golden file testing library where tests can be configured within the same test filelang_tester
Concise language testing framework for compilers and VMs (Linux only)libtest-mimic
Dynamically construct a test-harness that looks and behaves like Rust's built-in test harnesscompiletest_rs
The compiletest utility from the Rust compiler as a standalone testing harnessinsta
A snapshot testing library for Rustk9
Snapshot testing and better assertionsbulk_examples_generator
A tool created in Rust for create dozens/hundreds/thousands/millions of random examples based on a pest grammar (PEG)
Unicode
unicode-xid
Determine if a char is a valid identifier for a parser and/or lexer according to Unicode Standard Annex #31 rules.unicode-normalisation
Unicode character composition and decomposition utilities as described in Unicode Standard Annex #15unicode-segmentation
Iterators which split strings on Grapheme Cluster or Word boundaries, according to the Unicode Standard Annex #29 rulesunicode-width
Determine displayed width of char and str types according to Unicode Standard Annex #11 ruleslexical-sort
Lexicographical sorting of unicode strings
Incremental compilation
salsa
A generic framework for on-demand, incrementalized computationverde
A refreshingly simple incremental computation library
Floats/Ints/Bools
lexical
Lexical, to- and from-string conversion routines (Fast lexical conversion routines for bothstd
andno_std
environments)lexical-core
Lexical, to- and from-string conversion routines (Low-level, lexical conversion routines for use in ano_std
context)lexical_bool
A bool-like type that can be parsed from a stringryu
A Rust implementation of the PLDI'18 paper Ryū: fast float-to-string conversion by Ulf Adamsryu-js
Ryū-js is a fork of the ryu crate adjusted to comply to the ECMAScript number-to-string algorithmhexponent
C11 compliant hex float parsingordered-float
Total ordering on floatshalf
A half-precision floating pointf16
type for Rust implementing the IEEE 754-2008 standardf128
Bindings to the gcc quadmath libraryapprox
Approximate floating point equality comparisons and assertions
Binary & object file parsing, generating and processing
goblin
An impish, cross-platform, ELF, Mach-o, and PE binary parsing and loading crategimli
A library for reading and writing the DWARF debugging format.faerie
ELF and Mach-o native binary object file emitterobject
A unified interface for reading and writing object file formats.elf
A pure-rust library for parsing ELF fileselfkit
An elf parser and manipulation library in pure rust
Symbolic Execution
haybale
Symbolic execution of LLVM IR
Solvers
rsmt2
Wrapper for SMT-LIB 2 compliant SMT solvers.z3
A high-level rust bindings for the Z3 SMT solver from Microsoft Researchz3-sys
Low-level bindings for the Z3 SMT solver from Microsoft Researchz3_ref
A high level interface to the Z3 SMT solverz3d
Z3 DSL interface for Rustboolector
Safe high-level bindings for the Boolector SMT solverboolector-sys
Low-level bindings for the Boolector SMT solversmt2utils
Libraries and tools for the SMT-LIB-2 standardsmt2parser
A generic parser for SMT2 commands, as specified by the SMT-LIB-2 standardsmt2proxy
An experimental binary tool to intercept and pre-process SMT2 commands before they are send to an SMT solverz3tracer
An experimental parser for Z3 tracing logs obtained by passingtrace=true proof=true
to Z3
good_lp
Mixed Integer Linear Programming for Rust, with an user-friendly API. This crate allows modeling LP problems, and lets you solve them with various solvers.- Axiom Profiler A tool for visualising, analysing and understanding quantifier instantiations made via E-matching in a run of an SMT solver
- [2017][PDF] Counterexample Guided Inductive Optimization based on Satisfiability Modulo Theories
CLI
structopt
Parse command line arguments by defining a structclap
A simple to use, efficient, and full-featured Command Line Argument Parserpico-args
An ultra simple CLI arguments parserargh
A derive-based argument parser optimized for code size
Configuration
etcetera
A library that aims to allow you to determine the locations of configuration, cache and data files for your application. Existing Rust libraries generally do not give you a choice in terms of which standards/conventions (Etcetera calls these ‘strategies’) they follow. Etcetera, on the other hand, gives you the choice