Skip to content

Commit 58d94a7

Browse files
authored
Allow start functions to call imports. (#300)
Remove the restriction on component start functions calling imports. This allows start functions to run artbitrary user code.
1 parent 842b488 commit 58d94a7

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

design/mvp/Explainer.md

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1624,18 +1624,6 @@ three runtime invariants:
16241624
more-efficient non-reentrant runtime glue code (particularly in the middle
16251625
of the [Canonical ABI](CanonicalABI.md)). This implies that components by
16261626
default don't allow concurrency and multi-threaded access will trap.
1627-
3. Components enforce the current informal rule that `start` functions are
1628-
only for "internal" initialization by trapping if a component attempts to
1629-
call a component import during instantiation. In Core WebAssembly, this
1630-
invariant is not viable since cross-module calls are often necessary when
1631-
initializing shared linear memory (e.g., calling `libc`'s `malloc`).
1632-
However, at the granularity of components, this invariant appears viable and
1633-
would allow runtimes and toolchains considerable optimization flexibility
1634-
based on the resulting purity of instantiation. As one example, tools like
1635-
[`wizer`] could be used to *transparently* snapshot the post-instantiation
1636-
state of a component to reuse in future instantiations. As another example,
1637-
a component runtime could optimize the instantiation of a component DAG by
1638-
transparently instantiating non-root components lazily and/or in parallel.
16391627

16401628

16411629
## JavaScript Embedding

0 commit comments

Comments
 (0)