You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think it will improve the software community ecology if we can support bind wasm which satisfies the requirement of linking. It means we can call c/c++(maybe other language based on LLVM like rust but I don't try it) function in assemblyscript.
How to implement in assemblyscript:
First step we can add a command line option to preload one wasm file and add it into Program instance and then compile wasm module.
Second step maybe statement like import * as xxx from "xxx.wasm" can be supported, but it needs more effort.
I wonder if this proposal meets the roadmap of the community and if this PR can be merged into main.
How to handle multiple memory manager:
Memory.grow in wasm should be checked and it will trigger a compile-time Error.
For c/cpp, most of code will alloc memory by malloc / free / realloc in libc, so it can be resolved by using custom libc. e.g. https://github.com/WebAssembly/wasi-sdk
The text was updated successfully, but these errors were encountered:
On a sidenote, specifying MALLOC_IMPL=none when compiling wasi-libc won't compile any malloc implementation, which lets us provide our own. Alternatively, we could fork wasi-libc and add our own implementation there.
First step we can add a command line option to preload one wasm file and add it into Program instance and then compile wasm module.
There is more to this if we want to link properly. For instance, if the preloaded module has a static memory region and a heap region, besides reusing an existing / providing a shared malloc/free, AS would still need to add to the static memory region, which then conflicts with the preloaded module's heap region that typically starts right after. Can't get around relocatable modules, likely with some metadata, akin to what the dylink section does.
Forget about wasi-libc btw., that's overly specific and won't really help with linking anyway.
Feature suggestion
I think it will improve the software community ecology if we can support bind wasm which satisfies the requirement of linking. It means we can call c/c++(maybe other language based on LLVM like rust but I don't try it) function in assemblyscript.
How to implement in assemblyscript:
First step we can add a command line option to preload one wasm file and add it into
Program
instance and then compile wasm module.Second step maybe statement like import * as xxx from "xxx.wasm" can be supported, but it needs more effort.
I wonder if this proposal meets the roadmap of the community and if this PR can be merged into main.
How to handle multiple memory manager:
Memory.grow in wasm should be checked and it will trigger a compile-time Error.
For c/cpp, most of code will alloc memory by malloc / free / realloc in libc, so it can be resolved by using custom libc. e.g. https://github.com/WebAssembly/wasi-sdk
The text was updated successfully, but these errors were encountered: