andrew-johnson-4 / lambda-mountain

Compiler Backend for LSTS (Typed Macro Assembler)
https://andrew-johnson-4.github.io/lambda-mountain/
MIT License
20 stars 1 forks source link

Move towards list repesentation for app args instead of cons lists #969

Open andrew-johnson-4 opened 4 days ago

andrew-johnson-4 commented 4 days ago

This is a lot better for compiler internals. It could even be pushed forward to Preprocessor eventually.

(f a b) != ((f a) b)

This would help differentiate cons args from curried application at the syntactic level.

andrew-johnson-4 commented 4 days ago

As a midway point just add a sigil to app indicating that this is a Cons argument.

andrew-johnson-4 commented 4 days ago

The goal would be to make compiler internals in such a way that this representation doesn't matter. Use a for-each loop instead of recursive destructuing.

andrew-johnson-4 commented 4 days ago

TODO

then internal representation can be swapped by redefining the AST definition, .args-list, and app only.