Skip to content

Import memory into Wasm compiled from Grain #1364

Answered by ospencer
radkomih asked this question in Help
Discussion options

You must be logged in to vote

Hiya! This was answered on Discord, but we figured we should post here as well! It's possible to import host-provided functions and export specific globals, but it's not currently possible to import a host memory. This is mostly a matter of how memory management works in WebAssembly at the moment. Grain programs need to manage the memory, and thus it's far more feasible for Grain programs to export a memory. This will definitely change as the wasm GC proposal matures.

There are some upcoming docs on how to import host-provided functions, but in the meantime you can see some examples of this in https://github.com/grain-lang/lunatic-gr.

It's certainly pretty low level at the moment, so plea…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ospencer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants