Replies: 1 comment 1 reply
-
While I can't agree more on all of the said above, there is still a catch:
Codegen without intermediate bytecode would likely have to employ something like ANF as its intermediate language, and even though it's easier to understand by a compiler engineer, I don't think it would as well be to an average JS programmer. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm not sure there is enough value in generating bytecode before we generate code to make up for the complexity and difficulty in tracking sourcemap information accurately. That pass does provide the following in an output-independent way:
"foo"
)[bar]
)The goals of any new approach would be:
What I was thinking about building was a template system that:
Although we could probably whip something up without that much difficulty, I'd like to try to reuse something that already exists. @babel/template and @babel/generator might have most of what we need out of the box. I'm worried about runtime size and performance, but those are things we can measure.
My proposed course of action would be to play with the code in @peggyjs/eslint-plugin that generates simplified JS from a grammar file. We could see how that feels before deciding if we wanted to do anything similar to Peggy itself.
Beta Was this translation helpful? Give feedback.
All reactions