-
Notifications
You must be signed in to change notification settings - Fork 193
Discussion: Restructuring OCaml stdlib (original source) to make string compilation better. #924
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
Wouldn't this require that JavaScript strings support all the contents that MlBytes support? |
You could, with some effort, already recognize the sequence of instructions generated for
How does To make this work in JavaScript, I'd like to change the representation of string to be represented as JavaScript string directly (see #923) |
My question about the string |
@hhugo How close is that diff to being ready? That's pretty exciting stuff. |
#923 works already but I'd like to control the new behavior with a flag. |
I cannot give you any ETA |
I'm mostly curious if you think that you have solved all the major challenges with that approach. Having a flag does sound reasonable. |
see #977 |
Uh oh!
There was an error while loading. Please reload this page.
I'm not sure what would be required of JavaScript compilation but as part of rehp it had occurred to me that we could output much better string representations if the standard library of OCaml moved more of its string operations to externs:
For example the definition of
^
:If compiling using the jsoo bytecode decompiler, and when targeting PHP/Hack, we could actually just emit plain string concatenation in the output. I also believe this is possible in JavaScript as well (by implementing a
toString()
onMlBytes
). But this would require intercepting the^
which is currently not defined as an extern. It seems it could be implemented as an external without much downside.If possible, this would improve readability of the output and improve performance of
^
.The text was updated successfully, but these errors were encountered: