You can’t call Wasm functions from inside Elm code (you can’t do that with JS either). Instead you’d need to use ports to pass messages out of your Elm app to some JS code which can then do whatever it wants, which in your case would be calling Wasm.
Oh wow thanks. By the way you can actually call functions written in C/C++ in js by using imports.
Sorry if I was a bit vague with my wording.
How does that work exactly?
From MDN docs: WebAssembly/Loading_and_running it says:
WebAssembly is not yet integrated with
<script type='module'>or ES2015
importstatements, thus there is not a path to have the browser fetch modules for you using imports.
And then it goes on to explain the approaches to loading, instantiating and running the code.
What are you referring to?
This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.