Taming the Flat AST: Ergonomics in the Age of Zero Allocations
modern-c.blogspot.com·9h·
Discuss: Lobsters, r/golang
©️C Programming
Preview
Report Post

Taming the Flat AST: Ergonomics in the Age of Zero Allocations

Last week, I introduced egg, a modern LL(1) parser generator for Go. The response from the community was insightful, particularly regarding egg’s most distinct feature: the flat AST.

To achieve high performance and low garbage collection pressure, egg encodes the entire Abstract Syntax Tree (AST) into a single []int32 slice. While this is excellent for the CPU cache, it can be intimidating for the developer.

One commenter on the Gophers Slack put it perfectly:

"The ‘Traversing the AST’ section really dissuades me from using this tool... I think coming up with a clean, well-typed API might be harder than I think."

Th…

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help