Previously, we, begrudgingly, parsed some syntax into a Concrete Syntax Tree (CST) . With that tarpit deftly dodged, we can proceed to our next pass desugaring. Desugaring removes syntax sugar and maps our CST onto our Abstract Syntax Tree (AST). Our CST leaves us with a lot of cruft, such as | or =. This stuff was important for telling head from tail in our initial source file, and we’ll want to have it around when we’re reporting diagnostics, but the rest of the compiler doesn’t really care about such mundane affairs. Desugaring helps us strip away all the syntax and focus in on what’s important, lightening the cognitive load for following compiler passes.

But… do we really gotta? It seems like a pain. Can’t the later passes …

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