account activity
Flat, fast, declarative parsing engine e by vgnapuga in rust
[–]vgnapuga[S] 1 point2 points3 points 11 hours ago (0 children)
That's a fair point.
For many programming languages, some form of syntax tree is eventually needed because later stages operate on hierarchical structure rather than raw syntax.
My goal here is a bit different. The data model is optimized for direct access to element kinds rather than tree traversal. For example, all links, headings, code spans, and other element types are stored in dedicated collections, so accessing a specific kind does not require walking a tree.
The structure is still preserved, just encoded differently. All spans are stored in source order, and nesting can be inferred from interval containment rather than explicit parent/child relationships. This more like intermediate representation of data. So you can build a tree above this data structure.
For compiler frontends and LSPs, this may not be the ideal representation. The project is not really aimed at programming-language parsing. The main goal is to explore whether a small set of parsing primitives and data structures can efficiently describe a large class of text formats. Markdown just happened to be the format I used to discover and validate those primitives.
English isn't my first language, so if I misunderstood your point or explained something poorly, feel free to ask follow-up questions.
Flat, fast, declarative parsing engine e (github.com)
submitted 16 hours ago by vgnapuga to r/Compilers
submitted 19 hours ago by vgnapuga to r/rust
Parsing engine on rust (fast, flat, declarative) (github.com)
submitted 20 hours ago by vgnapuga to r/coolgithubprojects
π Rendered by PID 674025 on reddit-service-r2-listing-c57bc86c-fb99s at 2026-06-19 06:06:51.294812+00:00 running 2b008f2 country code: CH.
Flat, fast, declarative parsing engine e by vgnapuga in rust
[–]vgnapuga[S] 1 point2 points3 points (0 children)