shfty-elysian / elysian-legacy

Field function compiler
0 stars 0 forks source link

Consider replacing top-level Expr with free-standing AsIR implementors #106

Open Shfty opened 1 year ago

Shfty commented 1 year ago

Currently, the top-level AST mixes and matches DynAsIR and Expr. In light of the need for a Match equivalent, it feels like there's some higher-order abstraction that could be emplaced here by converting the enum-based Expr into a set of individual structs under AsIR.

Coming at it from a functional angle, all of the existing enum members are effectively functions, and AsIR effectively resolves to one or more functions. Literal is akin to const, arithmetic expressions etc. are obvious, and so on.