# Engineering High Performance Parsers (with Zig)

**URL:** <https://ziggit.dev/t/engineering-high-performance-parsers-with-zig/16761>\
**Category:** Media\
**Tags:** llm\
**Created:** [July 17, 2026, 5:15pm UTC](https://ziggit.dev/t/engineering-high-performance-parsers-with-zig/16761 "2026-07-17T17:15:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Southporter](https://ziggit.dev/user_avatar/ziggit.dev/southporter/32/2500_2.png) [@Southporter](https://ziggit.dev/u/Southporter)\
**Post date:** [July 17, 2026, 5:15pm UTC](https://ziggit.dev/t/engineering-high-performance-parsers-with-zig/16761/1 "2026-07-17T17:15:47Z")

</div>

> **[Engineering High-Performance Parsers with Data-Oriented Design](https://www.arshad.fyi/writings/engineering-high-performance-parsers)**
>
> Notes from building Yuku: the AST is flat arrays of u32 indices instead of a pointer tree, and memory layout, allocation, strings, unicode, and serialization all follow from that one decision.

Good breakdown of Data Oriented Design for parsers.

---

<div class="post-metadata">

**Author:** ![mappoTrell](https://ziggit.dev/user_avatar/ziggit.dev/mappotrell/32/9260_2.png) [@mappoTrell](https://ziggit.dev/u/mappoTrell)\
**Post date:** [July 17, 2026, 5:41pm UTC](https://ziggit.dev/t/engineering-high-performance-parsers-with-zig/16761/2 "2026-07-17T17:41:52Z")

</div>

Very interresting. I’m currently building a crdt implementation derived from [Rope science - Introduction](https://xi-editor.io/docs/rope_science_00.html) and the xi-editor it is about, written in rust. It uses B-Trees and I use a very similar strategy to the one in the article to store the internal and leaf nodes referenced by stable Indexes.

---

<div class="post-metadata">

**Author:** ![zmitchell](https://ziggit.dev/user_avatar/ziggit.dev/zmitchell/32/5377_2.png) [@zmitchell](https://ziggit.dev/u/zmitchell)\
**Post date:** [July 17, 2026, 7:19pm UTC](https://ziggit.dev/t/engineering-high-performance-parsers-with-zig/16761/3 "2026-07-17T19:19:31Z")

</div>

This post is explaining how the Zig parser works without acknowledging that. This was also written about a while ago: [Zig Parser – Mitchell Hashimoto](https://mitchellh.com/zig/parser)

Without pointing out the prior art it feels a little bit like plagiarism.

---

<div class="post-metadata">

**Author:** ![KilianHanich](https://ziggit.dev/user_avatar/ziggit.dev/kilianhanich/32/8254_2.png) [@KilianHanich](https://ziggit.dev/u/KilianHanich)\
**Post date:** [July 17, 2026, 11:09pm UTC](https://ziggit.dev/t/engineering-high-performance-parsers-with-zig/16761/4 "2026-07-17T23:09:24Z")

</div>

How do you deal with ambiguous syntax?

As in when you need to just pick one of the possibilities and see if that parses successfully. After all that would create nodes in the normal arrays.

Would you just save the current index, then try and if it doesn’t work just delete everything after that index?

---

<div class="post-metadata">

**Author:** ![gonzo](https://ziggit.dev/user_avatar/ziggit.dev/gonzo/32/54_2.png) [@gonzo](https://ziggit.dev/u/gonzo)\
**Post date:** [July 18, 2026, 8:30am UTC](https://ziggit.dev/t/engineering-high-performance-parsers-with-zig/16761/5 "2026-07-18T08:30:57Z")

</div>

(Cleaning up the cobwebs in my memory…) This is what GLR parsers do: they basically follow all possible parses, and when one of the currently possible parses is found to be invalid, it is abandoned. The practical case is that for many grammars for programming languages, and for most interesting programs, there usually is only one valid parse at the end. Of course, the trick is doing this in an efficient manner, not only from an algorithmic PoV, but also in how you represent this “forest of parse trees” efficiently.
