-
Hi there,
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
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 please reach out on Discord if you need any help getting things working! |
Beta Was this translation helpful? Give feedback.
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…