Meon - declarative parsing engine with no AST

โš“ Rust    ๐Ÿ“… 2026-07-05    ๐Ÿ‘ค surdeus    ๐Ÿ‘๏ธ 3      

surdeus

meon โ€” declarative flat-parsing engine (SoA, no AST)

I started this as a simple Markdown parser. Then I got curious about making it faster, and that curiosity turned into a bigger architectural question: instead of building a tree/AST, what if the parser output flat arrays โ€” one Vec per element kind (headings, bold spans, links, etc.), all as zero-copy byte-offset spans into the source?

That idea grew into a small engine: you describe a grammar once via define_parser! and get a generated parser with no runtime dispatch. The Markdown parser became just one concrete grammar built on top of it. I later added a JSON grammar to prove the engine isn't Markdown-specific.

This project ended up as the basis of my coursework (3rd year, university), so it's had a fair amount of design iteration โ€” but it's also grown past a toy project, and I'd like a critical outside look before I consider it more "done."

Repo structure (workspace, 4 crates):

  • meon โ€” the core engine + define_parser! macro runtime
  • meon-macros โ€” the proc-macro itself
  • meon-md โ€” Markdown grammar (reference implementation)
  • meon-json โ€” JSON grammar (reference implementation, proves the engine generalizes)

Also included: criterion benchmarks (comparisons against pulldown-cmark/serde_json where relevant) and a cargo-fuzz harness.

Repo: GitHub - vgnapuga/meon: Declarative flat parsing engine. No AST - only SoA tables, zero-copy spans and SIMD/SWAR ยท GitHub

1 post - 1 participant

Read full topic

๐Ÿท๏ธ Rust_feed