-
Notifications
You must be signed in to change notification settings - Fork 9
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
[FEATURE REQUEST] Examples for building Dune libraries #56
Comments
o1-labs/integers_stubs_js#10 is an example of adding Wasm stubs to a library. It works when using the required fork of Dune referenced in the readme. Does that help solve your problem? |
Hey @OlivierNicole, thank you so much for your reply! I have followed the example provided, and using that the change that I've applied has only been to add this stanza: (js_of_ocaml
(javascript_files ./heyworld.js)
(wasm_files heyworld.wat)
) The generated Have you hand-crafted or edited the |
Sorry for the late reply. The WebAssembly code is written by hand. |
No problem, thank you for letting me know. |
I might have misunderstood your question. The primitives (declared as To build a library and not an executable, the instructions in #36 should work. I don’t think separate compilation is supported by our Dune fork yet, but @vouillon knows better. |
Is your feature request related to a problem? Please describe.
Currently the examples are for building executables (Dune files with the
executable
Stanza), and these are output into.wat
files with(export "_initialize")
.I am trying to output a basic library, and export the functions of that library to use within Web Assembly.
Describe the solution you'd like
I would like to be able to export multiple functions, and for examples to be provided for this.
I am not sure if this is currently possible with the tool.
Describe alternatives you've considered
I have tried the examples, as well as my own
.ml
&.mli
files. I have also tried to use the--export
and--wrap-with-fun
options but these have not worked for me (they seem to be for JSOO). (I have even browsed this repo that was linked in another issue.)The text was updated successfully, but these errors were encountered: