-
-
Notifications
You must be signed in to change notification settings - Fork 680
Open
Labels
Description
Several folks having been looking at running AssemblyScript programs in Wasmtime, and while single-module programs work great, multiple-module programs, and programs which call into host APIs that need to call back into the AssemblyScript runtime, currently depend on cyclic imports, which not supported in the wasm spec.
There are two main techniques for avoiding such cycles:
- In some cases, modules can be split, eg. replacing
A -> B; B-> AwithA0 -> B; B-> A1. This technique might be useful for the AssemblyScript memory allocation functions, splitting them into a separate module that other modules, and the host, can depend on. - Otherwise, import edges can be converted to dynamic edges, using
call_indirectas described here.
One example of this is mentioned in this comment in an earlier issue.