jonathanhogg / flitter

A functional programming language and declarative system for describing 2D and 3D visuals
https://flitter.readthedocs.io
BSD 2-Clause "Simplified" License
39 stars 1 forks source link

Convert language into a pure expression tree #53

Closed jonathanhogg closed 3 months ago

jonathanhogg commented 3 months ago

Eliminate the special treatment of Top by making all let-likes "in" expressions. Inject a new Export AST node at the end of the file – and thus the deepest point in the tree. This exports all defined names to allow importing to work. Language is now less rigid and allows functions and imports to be anywhere. However, pragmas must now be at the top. These are extracted by the parser instead of the runtime and so must be simple literal AST nodes (a single number, string, etc.).