-
Notifications
You must be signed in to change notification settings - Fork 191
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
Wasm text file preprocessor #1822
base: master
Are you sure you want to change the base?
Conversation
22aa8ab
to
408fc17
Compare
Have you considered using this to add sugars to help write control flows (e.g having a |
That seems a good idea, indeed! |
compiler/bin-wasmoo_util/dune
Outdated
@@ -0,0 +1,17 @@ | |||
(executable | |||
(name wasmoo_util) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you consider having subcommands inside wasm_of_ocaml instead ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have the issue that wasmoo_util link
is used to build the runtime which is then included in wasm_of_ocaml
.
But maybe I can have an internal binary to do that and also expose the same functionality as a wasm_of_ocaml subcommand.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't the runtime be linked later ? If we want to have it conditional on flags such as use-js-strings ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My current plan is to have a set of precompiled runtimes for the most common options, and to compile runtimes on the fly otherwise.
It's a bit slow to compile and link the runtime. That's especially noticeable when we have a large number of executables, like with the Js_of_ocaml test suite.
But maybe we could share the runtimes produced by wasm_of_ocaml build-runtime
between executables, using a similar trick in dune as for ppxs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But maybe I can have an internal binary to do that and also expose the same functionality as a wasm_of_ocaml subcommand.
I have implemented this. Does this look good to you?
32f8b5d
to
28907d4
Compare
This provides a better debugging experience since reference to these functions will now use an id rather than a number in disassembled code.
For a start, it is only used to manage runtime differences between OCaml versions, and to provide some syntactic sugar for strings. But I plan to use it for a WASI version of the runtime and to implement the use-js-string flag.