-
Notifications
You must be signed in to change notification settings - Fork 564
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
Imperative core, initial refactoring #2723
Conversation
Should a generic imperative core really have constructs like |
I agree with @michaelficarra, and have a bunch of suggestions of my own, but if the idea is to do this incrementally then I'm fine with merging it as we have it just now. I just have two immediate points:
|
Sounds good. I'll try to work on those later. Yes, I agree, ideally the core language shouldn't use JS constructs like |
@garyb It's called I think we should wait to add a separate JS AST until we know we need it. Allocating a whole new AST might incur a performance penalty, however slight. So, since the two structures are identical right now, I'd like to see if we can do this incrementally instead. |
I've removed |
I've made some progress on breaking the AST into expressions and statements. I tried something a bit different this time - instead of using a separate ADT for each syntactic domain, I just modified the existing AST type by making it into a GADT. It works quite nicely and simplifies the traversals quite a bit. |
@paf31 Wait, we're still using |
@michaelficarra Yes we are, but regardless of whether we use |
👍 I love it. |
* Extract first version of an imperative core from the JS AST * Remove redundant import * Remove TypeOf
* Extract first version of an imperative core from the JS AST * Remove redundant import * Remove TypeOf
This is not what I think the final imperative core should look like, but it does the initial refactoring to move the modules around and rename various things. I would still like to (at least)
but I would prefer to do these things after this PR is merged, so that it doesn't sit and get out of date while we decide what the AST should look like.
Thoughts?