You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Creating components in specific source languages
2
2
3
-
WebAssembly can be targeted by the majority of top programming
4
-
languages; however, the level of
5
-
support varies. This document details the subset of languages that target WASI and support
6
-
components.
3
+
Many popular programming languages can be compiled to WebAssembly,
4
+
but the level of support varies across languages.
5
+
This document details languages with compilers and runtimes
6
+
that support WebAssembly with WASI as a target language.
7
7
8
8
> This is a living document, so if you are aware of advancements in a toolchain, please do
9
9
not hesitate to [contribute documentation](https://github.com/bytecodealliance/component-docs/blob/main/CONTRIBUTING.md). You can find more information about the development of support for specific languages in the [Guest Languages Special Interest Group Proposal](https://github.com/bytecodealliance/governance/blob/main/SIGs/SIG-guest-languages/proposal.md) document.
@@ -20,10 +20,9 @@ components within and among toolchains.
-[Building a Component with `wasm-tools`](./language-support/language-agnostic.md#building-a-component-with-wasm-tools)
25
+
-[Running a Component with Wasmtime](./language-support/language-agnostic.md#running-a-component-with-wasmtime)
27
26
-[C/C++ Tooling](./language-support/c.md)
28
27
-[Building a Component with `wit-bindgen` and `wasm-tools`](./language-support/c.md#building-a-component-with-wit-bindgen-and-wasm-tools)
29
28
-[Running a Component from C/C++ Applications](./language-support/c.md#running-a-component-from-cc-applications)
@@ -38,55 +37,3 @@ run components for a given toolchain:
38
37
-[Rust Tooling](./language-support/rust.md)
39
38
-[Building a Component with `cargo component`](./language-support/rust.md#building-a-component-with-cargo-component)
40
39
-[Running a Component from Rust Applications](./language-support/rust.md#running-a-component-from-rust-appliacations)
41
-
42
-
## Language Agnostic Tooling
43
-
44
-
### Building a Component with `wasm-tools`
45
-
46
-
[`wasm-tools`](https://github.com/bytecodealliance/wasm-tools) provides a suite of subcommands for
47
-
working with WebAssembly modules and components.
48
-
49
-
`wasm-tools` can be used to create a component from WebAssembly Text (WAT). This walks through creating a component from WAT that implements the [`adder` world](https://github.com/bytecodealliance/component-docs/blob/main/component-model/examples/tutorial/wit/adder/world.wit) and simply adds two numbers.
50
-
51
-
1. Install [`wasm-tools`](https://github.com/bytecodealliance/wasm-tools/tree/main#installation), a
52
-
tool for low-level manipulation of Wasm modules and components.
53
-
2. The `add` function is defined inside the following `world` world:
54
-
55
-
```wit
56
-
package docs:adder@0.1.0;
57
-
58
-
interface add {
59
-
add: func(x: u32, y: u32) -> u32;
60
-
}
61
-
62
-
world adder {
63
-
export add;
64
-
}
65
-
```
66
-
67
-
3. Define an `add` core module in WAT that exports an `add` function that adds two parameters:
[`wasm-tools`](https://github.com/bytecodealliance/wasm-tools) provides a suite of subcommands for
6
+
working with WebAssembly modules and components.
7
+
8
+
`wasm-tools` can be used to create a component from WAT.
9
+
Here's how to create a component from WAT
10
+
that implements the [`adder` world](https://github.com/bytecodealliance/component-docs/blob/main/component-model/examples/tutorial/wit/adder/world.wit)
11
+
and simply adds two numbers.
12
+
13
+
1. Install [`wasm-tools`](https://github.com/bytecodealliance/wasm-tools/tree/main#installation), a
14
+
tool for low-level manipulation of Wasm modules and components.
15
+
2. The `add` function is defined inside the following world.
16
+
Create a file called `adder.wit` whose contents are as follows:
17
+
18
+
```wit
19
+
package docs:adder@0.1.0;
20
+
21
+
interface add {
22
+
add: func(x: u32, y: u32) -> u32;
23
+
}
24
+
25
+
world adder {
26
+
export add;
27
+
}
28
+
```
29
+
30
+
3. Define an `add` core module in WAT that exports an `add` function that adds two parameters.
31
+
Create a file called `add.wat` whose contents are as follows:
0 commit comments