-
-
Notifications
You must be signed in to change notification settings - Fork 672
Rework resolver #489
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rework resolver #489
Conversation
Most of the bare features that were necessary are in now. However, this obviously escalated to a point where half the compiler has been rewritten and shit will definitely hit the fan when merged. Going to take some additional time to go through the code step by step next, before regenerating tests and double checking them. |
Alright, this passes the test suite now. |
Ok, next up: Nested types for #423 |
6004bc9
to
f585289
Compare
Turns out that we can completely eliminate linking between AST nodes now, leading the path to making it easily serializable at some point and less memory consuming in general
this PR is breaking in many different ways, so it's a sensible thing to up the version
WOAH! Export * is now supported!!! 🎉 🎉 🎉 😄 😄 😄 Made my day, thank you @dcodeIO 👍 |
See: #473
The previously weird resolver logic has been replaced with less weird tree-based lookups, the internal IR changed accordingly and the AST updated to include nested type names that the resolver can now deal with.
Other notes:
export *
, fixes Supportexport *
#249--noTreeShaking
compiler flag has been removed and replaced with an explicit lazy compilation mechanism. Reason is that top-level control flow requires that namespace and static class members are compiled directly if these access mutable top-level variables. Otherwise, their values are wrong when compiled after top-level control flow has concluded.@lazy
was born. Downside is that compilation of a user program is now more like JS, upside is that compilation is now more like JS. Means: functions are compiled when used only, but globals are compiled sequentially with other top-level logic unless@lazy
.main
function by name, and make it call start to execute top-level logic when it's first called, this mechanism has been replaced with a@start
decorator. Any function can become the function that kicks off the module now and a user who uses@export function main
for other reasons won't be surprised anymore. fixes [bug] Split doesn't work with main function #476