Open jzabinski-dolios opened 2 years ago
This seems pretty doable.
do any other compilers do this (rust, clang etc)? might be nice to see how.
If this ends up being part of https://github.com/tinygo-org/tinygo/issues/2735 then we could close this one.
For WebAssembly, the embedder needs to use
wasm_exec
'srun(instance)
method inglobal.Go
so that TinyGo's runtime can be initialized prior to calling any of the WebAssembly module's exported functions. But there doesn't seem to be anything inglobal.Go
indicating whether the runtime has been initialized. An easy workaround would be to create a wrapper object forrun
elsewhere in Javascript, but I feel like it would be useful to store a variable indicating the initialization status of the runtime inglobal.Go
itself.