Grift icon indicating copy to clipboard operation
Grift copied to clipboard

Language AST should only be parameterized by the parts that change.

Open akuhlens opened this issue 7 years ago • 0 comments

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.

akuhlens avatar Mar 27 '18 17:03 akuhlens