Skip to content

Commit fb8acad

Browse files
fix: cm section
Signed-off-by: Victor Adossi <vadossi@cosmonic.com>
1 parent 2db1009 commit fb8acad

File tree

1 file changed

+12
-8
lines changed
  • component-model/src/reference

1 file changed

+12
-8
lines changed

component-model/src/reference/faq.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,14 @@ A WebAssembly component is a WebAssembly binary that:
1414
- Adheres to the Component Model [Canonical ABI][cabi] for converting between rich types and those present in core WebAssembly.
1515
WebAssembly Components can (and often do) contain core modules, but generally WebAssembly core modules
1616
*cannot not* contain Components. One easy way to differentiate is by reading the WAT for a component:
17+
18+
[cabi]: https://github.com/WebAssembly/component-model/blob/main/design/mvp/CanonicalABI.md
19+
[cm-binary-format]: https://github.com/WebAssembly/component-model/blob/main/design/mvp/Binary.md
20+
[wasi-p1]: https://github.com/WebAssembly/WASI/blob/main/legacy/preview1/witx/wasi_snapshot_preview1.witx
21+
[wasm-core-spec]: https://webassembly.github.io/spec/core/
22+
1723
## Q: How can I tell if a WebAssembly binary is a component or a module?
24+
1825
A WebAssembly core module generally consists of a `(module)` s-expression:
1926
```wat
2027
(module
@@ -31,14 +38,6 @@ nested `(module)`/`(component)` s-expressions):
3138
)
3239
```
3340

34-
One part that might cause confusion here is that a WASI Preview 1 "component" is in fact a
35-
*core module*. More precisely, a Preview 1 "component" is a WebAssembly core module with a well-defined
36-
set of imports and exports ([legacy specification][wasi-p1]).
37-
38-
[cabi]: https://github.com/WebAssembly/component-model/blob/main/design/mvp/CanonicalABI.md
39-
[wasi-p1]: https://github.com/WebAssembly/WASI/blob/main/legacy/preview1/witx/wasi_snapshot_preview1.witx
40-
[wasm-core-spec]: https://webassembly.github.io/spec/core/
41-
4241
## Q: How do WebAssembly Components and the WebAssembly System Interface (WASI) relate to each other?
4342

4443
While WebAssembly core module *can* represent higher level types using the available primitives, every binary and platform
@@ -75,6 +74,9 @@ https://github.com/WebAssembly/WASI/tree/main/wasip2
7574
Many programming language toolchains may only support Preview 1 components natively, but this isn't a problem
7675
in practice as Preview 1 components can be *adapted* into Preview 2 components automatically.
7776

77+
While somewhat confusing a WASI Preview 1 "component" is in fact a *WebAssembly core module*. More precisely, a
78+
Preview 1 "component" is a WebAssembly core module with a well-defined set of imports and exports ([legacy specification][wasi-p1]).
79+
7880
## Q: What are component imports?
7981

8082
WebAssembly components are self-describing -- information about required external functionality (which must be provided by the platform or another component) is included in the binary.
@@ -135,3 +137,5 @@ Please contribute to the Component Book by filing your question (or one that you
135137
[an issue on GitHub][gh-issues].
136138

137139
[gh-issues-new]: https://github.com/bytecodealliance/component-docs/issues/new
140+
141+
[!NOTE]: #

0 commit comments

Comments
 (0)