Updated the AssemblyScript example (#3185)
This commit is contained in:
@@ -1,18 +1,9 @@
|
||||
# AssemblyScript
|
||||
|
||||
[AssemblyScript] 0.10.0 includes support for targeting WASI. To use it, add
|
||||
[AssemblyScript] has included support for targeting WASI since version 0.10.0. To use it, add
|
||||
`import "wasi"` at the top of your entrypoint file.
|
||||
|
||||
To create a program which can be run directly as a command, pass `--runtime half`
|
||||
to the AssemblyScript linker. This selects the [half runtime], which ensures that
|
||||
the generated wasm module doesn't contain any extraneous exports. (This isn't
|
||||
strictly required today, but the handling of extraneous exports may change in
|
||||
the future, so it's encouraged. As a bonus, it also reduces code size.)
|
||||
|
||||
To create a program which can be loaded as a library and used from other modules,
|
||||
no special options are needed.
|
||||
|
||||
Let's walk through a simple hello world example.
|
||||
Let's walk through a simple hello world example using the latest AssemblyScript runtime (at the time of this writing, it is AssemblyScript runtime included in version 0.19.x):
|
||||
|
||||
## `wasi-hello-world.ts`
|
||||
|
||||
@@ -49,5 +40,4 @@ repository to run the example locally.
|
||||
[code]: https://github.com/bytecodealliance/wasmtime/blob/main/docs/assemblyscript-hello-world
|
||||
[AssemblyScript]: https://assemblyscript.org
|
||||
[as-wasi]: https://github.com/jedisct1/as-wasi
|
||||
[half runtime]: https://docs.assemblyscript.org/details/runtime#runtime-variants
|
||||
[Wasmtime API]: ./lang.md
|
||||
|
||||
Reference in New Issue
Block a user