@@ -283,7 +283,13 @@ into the host, there is only a `Subtask`.
283283Based on this, the call stack when a component calls a host-defined import will
284284be a call stack of the general form:
285285```
286- [Host caller] <- [Task] <- [Subtask+Task]* <- [Subtask] <- [Host callee]
286+ [Host]
287+ ↓ host calls component export
288+ [Component Task]
289+ ↓ component calls import implemented by another component's export 0..N times
290+ [Component Subtask <> Component Task]*
291+ ↓ component calls import implemented by the host
292+ [Component Subtask <> Host task]
287293```
288294Here, the ` <- ` arrow represents the ` supertask ` relationship that is immutably
289295established when first making the call. A paired ` Subtask ` and ` Task ` have the
@@ -742,7 +748,6 @@ The stackful ABI is currently gated by the 🚟 feature.
742748
743749The async stackful export function signature for export ` foo ` (defined above
744750in world ` w ` ) is:
745-
746751``` wat
747752;; async, no callback
748753(func (param $s-ptr i32) (param $s-len i32))
@@ -752,7 +757,6 @@ The parameters work just like synchronous parameters.
752757
753758There is no core function result because a callee [ returns] ( #returning ) their
754759value by * calling* the * imported* ` task.return ` function which has signature:
755-
756760``` wat
757761;; task.return
758762(func (param $ret-ptr i32) (result $ret-len i32))
@@ -767,7 +771,6 @@ used.
767771
768772The async stackless export function signature for export ` foo ` (defined above
769773in world ` w ` ) is:
770-
771774``` wat
772775;; async, callback
773776(func (param $s-ptr i32) (param $s-len i32) (result i32))
@@ -788,7 +791,6 @@ The `(result i32)` lets the core function return what it wants the runtime to do
788791
789792When an async stackless function is exported, a companion "callback" function
790793must also be exported with signature:
791-
792794``` wat
793795(func (param i32 i32 i32) (result i32))
794796```
0 commit comments