Grift
Grift copied to clipboard
Language AST should only be parameterized by the parts that change.
For instance
(struct (Arity Args Ret) Fn ([arity : Arity][args : Args][ret : Ret]))
Should be instantiated up to the expression parameterization, and should have unneeded fields removed extra fields can be added for some passes by sub typing on structs. This will likely lead to longer form definitions at the cost of less verbose types and code elsewhere.
(struct (Expr) Fn ([args : (Listof Expr)][ret : Expr])
Here we make the args list always be an args list, make the return type always match the parameter type, and remove the arity since it can be derived by taking the length of the argument list.