-
Notifications
You must be signed in to change notification settings - Fork 194
ES6 Support #508
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
Comments
Something new about ES6 support? |
no. I don't have time to work on this now. What's your use case ? |
No real use case for the moment but as lots of popular JavaScript frameworks switch to ES6 (like React and ReactNative), it would be great to have ES6 support. |
One way would be to rely on some external javascript parser (https://github.com/facebook/flow ?) |
Just for comparison: BuckleScript also compiles to ES5, but supports ES6 modules. |
WeakSet and WeakMap seem exciting to me. |
How are WeakSet and WeakMap related to this issue ? My understanding is that one can already use them to write bindings. |
I'm fact, they are already used in the jsoo runtime. js_of_ocaml/runtime/marshal.js Line 435 in 09d5731
|
Ah, I had thought the reason js_of_ocaml didn't support Weak was just because JavaScript doesn't support any form of weak references, but maybe I'm just wrong. Maybe it's just that either (1) things were different in the past or (2) WeakMap/WeakSet are somehow not sufficiently powerful. |
Indeed, the ocaml weak reference semantic cannot be implemented using weak map / weak set |
Oh, I see, WeakMap and WeakSet are not what I expected them to be. Their keys are weak! I have now also learned about WeakRef, but it looks like browser support is still quite limited. |
It might be worth revisiting this in 2021. Because the output uses Common JS, it can be difficult to integrate with existing projects that use modern, ES6 style JavaScript. ES6 would also allow the JS to work client-side or server-side by default, since browsers now have broad ES6 support. |
One could try to port new js feature implemented in https://github.com/returntocorp/pfff/blob/develop/lang_js/parsing/parser_js.mly |
WeakRef are now used to implement the ocaml weak semantic. |
#1386 allows to parse utf8 identifier. |
Uh oh!
There was an error while loading. Please reload this page.
http://es6-features.org
related to
The text was updated successfully, but these errors were encountered: