@@ -11,6 +11,7 @@ native JavaScript runtimes.
11
11
* [ Type definitions] ( #type-definitions )
12
12
* [ Type checking] ( #type-checking )
13
13
* [ Canonical definitions] ( #canonical-definitions )
14
+ * [ Canonical ABI] ( #canonical-built-ins )
14
15
* [ Canonical built-ins] ( #canonical-built-ins )
15
16
* [ Start definitions] ( #start-definitions )
16
17
* [ Import and export definitions] ( #import-and-export-definitions )
@@ -1026,6 +1027,18 @@ isolation than otherwise achievable with a shared global namespace.
1026
1027
1027
1028
### Canonical Definitions
1028
1029
1030
+ From the perspective of Core WebAssembly running inside a component, the
1031
+ Component Model is an [ Embedding] . As such, the Component Model defines the
1032
+ Core WebAssembly imports passed to [ ` module_instantiate ` ] and how Core
1033
+ WebAssembly exports are called via [ ` func_invoke ` ] . This allows the Component
1034
+ Model to specify how core modules are linked together (as shown above) but it
1035
+ also allows the Component Model to arbitrarily synthesize Core WebAssembly
1036
+ functions (via [ ` func_alloc ` ] ) that are imported by Core WebAssembly. These
1037
+ synthetic core functions are created via one of several * canonical definitions*
1038
+ defined below.
1039
+
1040
+ #### Canonical ABI
1041
+
1029
1042
To implement or call a component-level function, we need to cross a
1030
1043
shared-nothing boundary. Traditionally, this problem is solved by defining a
1031
1044
serialization format. The Component Model MVP uses roughly this same approach,
@@ -1791,6 +1804,11 @@ and will be added over the coming months to complete the MVP proposal:
1791
1804
[ func-import-abbrev ] : https://webassembly.github.io/spec/core/text/modules.html#text-func-abbrev
1792
1805
[ `core:version` ] : https://webassembly.github.io/spec/core/binary/modules.html#binary-version
1793
1806
1807
+ [ Embedding ] : https://webassembly.github.io/spec/core/appendix/embedding.html
1808
+ [ `module_instantiate` ] : https://webassembly.github.io/spec/core/appendix/embedding.html#mathrm-module-instantiate-xref-exec-runtime-syntax-store-mathit-store-xref-syntax-modules-syntax-module-mathit-module-xref-exec-runtime-syntax-externval-mathit-externval-ast-xref-exec-runtime-syntax-store-mathit-store-xref-exec-runtime-syntax-moduleinst-mathit-moduleinst-xref-appendix-embedding-embed-error-mathit-error
1809
+ [ `func_invoke` ] : https://webassembly.github.io/spec/core/appendix/embedding.html#mathrm-func-invoke-xref-exec-runtime-syntax-store-mathit-store-xref-exec-runtime-syntax-funcaddr-mathit-funcaddr-xref-exec-runtime-syntax-val-mathit-val-ast-xref-exec-runtime-syntax-store-mathit-store-xref-exec-runtime-syntax-val-mathit-val-ast-xref-appendix-embedding-embed-error-mathit-error
1810
+ [ `func_alloc` ] : https://webassembly.github.io/spec/core/appendix/embedding.html#mathrm-func-alloc-xref-exec-runtime-syntax-store-mathit-store-xref-syntax-types-syntax-functype-mathit-functype-xref-exec-runtime-syntax-hostfunc-mathit-hostfunc-xref-exec-runtime-syntax-store-mathit-store-xref-exec-runtime-syntax-funcaddr-mathit-funcaddr
1811
+
1794
1812
[ `WebAssembly.instantiate()` ] : https://developer.mozilla.org/en-US/docs/WebAssembly/JavaScript_interface/instantiate
1795
1813
[ `FinalizationRegistry` ] : https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry
1796
1814
0 commit comments