#parser-combinator #primitive #parser #core

nightly no-std oak-core

Core parser combinator library providing fundamental parsing primitives

5 releases

Uses new Rust 2024

new 0.0.4 Feb 14, 2026
0.0.3 Feb 12, 2026
0.0.2 Jan 30, 2026
0.0.1 Jan 23, 2026
0.0.0 Oct 20, 2025

#47 in Parser tooling

Download history 110/week @ 2025-10-29 156/week @ 2025-11-05 205/week @ 2025-11-12 145/week @ 2025-11-19 151/week @ 2025-11-26 152/week @ 2025-12-03 115/week @ 2025-12-10 187/week @ 2025-12-17 143/week @ 2025-12-24 133/week @ 2025-12-31 69/week @ 2026-01-07 107/week @ 2026-01-14 205/week @ 2026-01-21 278/week @ 2026-01-28 149/week @ 2026-02-04 1046/week @ 2026-02-11

1,678 downloads per month
Used in 174 crates (147 directly)

MPL-2.0 license

270KB
4K SLoC

💎 Oak Core

Crates.io Documentation

The Engine of Language Intelligenceoak-core is the heartbeat of the Oak ecosystem, providing the fundamental data structures and algorithms required for high-performance, incremental language processing.

🎯 Project Vision

Modern developer tools demand more than just a static parser; they require a dynamic system that can react to every keystroke. oak-core is built to provide this infrastructure. It abstracts away the complexities of incremental parsing, syntax tree management, and error recovery, allowing language authors to focus on the unique semantics of their language.

✨ Core Pillars

  • 🌳 Persistent Syntax Trees: Implements the "Green/Red Tree" architecture, enabling efficient immutability, lossless code representation, and high-performance tree transformations.
  • 🔄 Universal Incrementalism: Provides a generic framework for incremental updates that can be applied to any language, ensuring that only the necessary parts of the AST are re-evaluated.
  • 🛡️ Advanced Error Recovery: Features a sophisticated suite of recovery strategies that allow parsers to produce meaningful syntax trees even from highly fragmented or incorrect source code.
  • 🚀 Zero-Cost Abstractions: Written in pure Rust, the core ensures that the flexibility of the Oak framework comes with minimal runtime overhead.
  • 🧩 Extensible Framework: Designed as a modular library, it serves as the base for all oak-* parsers and high-level tools like oak-lsp.

🏗️ Architecture at a Glance

  1. Green Tree: An immutable, simplified, and address-agnostic representation of the syntax tree, optimized for sharing and caching.
  2. Red Tree: A thin, type-safe layer over the Green Tree that provides parent pointers and absolute positioning, optimized for developer ergonomics.
  3. Lexer/Parser Traits: Standardized interfaces that ensure consistency across all language implementations in the Oak ecosystem.

Dependencies

~5–7.5MB
~60K SLoC