-
Notifications
You must be signed in to change notification settings - Fork 186
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
Better runtime code #1672
Better runtime code #1672
Conversation
This allows external compilers such as esbuild to know which parts of the code can be optimised, so they can optimise more aggressively. |
0d972a5
to
8eaa8f9
Compare
I don't really see the connection with this PR. Can you elaborate? |
The PR introduce a bunch of es6 features. It would be nice to understand what that mean for compatibility |
Mixing formatting and other changes is not ideal for reviewing |
I just split the format commit to another PR: #1673 |
The scope is different for var and const/let.
The ES6 features used here are supported by all major browsers except IE11, and stable versions of Node.js up to 3 generations ago, and should Just Work™ without transpiling. |
8eaa8f9
to
32bfc01
Compare
We use Js_of_ocaml to compile OCaml down to Google Apps Script which has a modern javascript runtime, but it validates the code using (I think) an ES3 parser. We've had issues in the past where using modern features in the runtime.js files will break these app-script scripts. |
Also, could we avoid making big formatting changes until |
Can you explain the reasoning here ? |
@TyOverby, it seems that apps script should not be an issue anymore. Can you check and report back. It would be nice to be able to modernize the runtime a bit. |
56152d5
to
85c975f
Compare
Signed-off-by: Sora Morimoto <[email protected]>
Signed-off-by: Sora Morimoto <[email protected]>
Signed-off-by: Sora Morimoto <[email protected]>
Signed-off-by: Sora Morimoto <[email protected]>
Signed-off-by: Sora Morimoto <[email protected]>
Signed-off-by: Sora Morimoto <[email protected]>
Signed-off-by: Sora Morimoto <[email protected]>
Signed-off-by: Sora Morimoto <[email protected]>
Signed-off-by: Sora Morimoto <[email protected]>
Signed-off-by: Sora Morimoto <[email protected]>
A few months ago we had to remove bigint literals from a runtime file because it wasn’t supported, so if they are using v8, it’s a pretty old v8 |
Can you ask the people using app scripts to report what's supported ? |
46f25d3
to
5fdb95d
Compare
Signed-off-by: Sora Morimoto <[email protected]>
d56aafc
to
7ae6fd9
Compare
Ready for review... |
I originally missed the page which says that the migration to v8 happens automatically for some files, but not for others, so I'll check with those teams to see if they just didn't move over yet.
I can ask, but the maintainers of those scripts probably don't know more than I do, and are less equipped to test a bunch of language features. I'll hold off on doing this until I can confirm that they did in fact move their scripts to v8. |
Ok, I did some random testing, and the only modern feature (that I could find) that they don't support is bignum literals... The changes made in this PR seem fine |
Did you actually try to run app scripts against this PR ? |
Signed-off-by: Sora Morimoto <[email protected]>
0d3659f
to
6bfaf0b
Compare
@smorimoto, I've been looking at this a bit today. I think I would be more confortable reviewing such change piece by piece. One PR at a time. The following seems to make the lint happy
We could then start by fixing things like, Checks that we want to keep off should be annotated with a reason (can we have comments ?) |
@hhugo This PR is already fully completed and I believe no additional changes will be made. However, if you still prefer to split this up, I think I can split this PR into smaller pieces. (In other words, I'm trying to avoid it because it's not a very easy route 😅) |
No, and I won't be able to until wasm_of_ocaml is merged |
@smorimoto, as maybe shown in #1677, the changes in this PR are not as trivial as they may look at first.
|
Makes sense |
Similar to how janestreet/ppx_expect#54 is held back, I find the situation unpleasant.. |
Not only for style consistency, but also add semicolons and other things that are theoretically better to have.