unsplash / intlc

Compile ICU messages into code. Supports TypeScript and JSX. No runtime.
MIT License
56 stars 2 forks source link

Flat AST #168

Closed samhh closed 1 year ago

samhh commented 1 year ago

I'm experimenting with recursion schemes and more exotic and potentially better representations of the AST than recursive lists. Still, this changeset represents a subjective improvement regardless of whether or not that other stuff pans out. Rather than a series of mutually recursive sum types, the AST is now represented as a list of a single recursive sum type. This arguably improves both readability and writeability; no more "what is This?", and no more having to remember the names of the nested sum constructors.

The commits are large but each represent a very narrow change. Look at the Intlc.ICU module as a starting point for the AST change and then a quick look around elsewhere to see how it affects the codebase.