Add documentation for building programs using AssemblyScript. (#1782)
* Add documentation for building programs using AssemblyScript. * Add the assemblyscript hello world as an example and display it inline. * Move the AssemblyScript hello world into the docs directory. That way Cargo doesn't try to run it like a Rust example.
This commit is contained in:
35
docs/assemblyscript-hello-world/package-lock.json
generated
Normal file
35
docs/assemblyscript-hello-world/package-lock.json
generated
Normal file
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"name": "wasi-hello-world",
|
||||
"version": "1.0.0",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
"as-wasi": {
|
||||
"version": "0.1.1",
|
||||
"resolved": "https://registry.npmjs.org/as-wasi/-/as-wasi-0.1.1.tgz",
|
||||
"integrity": "sha512-7PrSjsD/K2Pg95/2fu+4RJCfZLiuM0w0k5lMceaCf73EvH+7WPQTM1WW/vS0cizRTaEDj8Wz5ttoZBJSvsZpBQ=="
|
||||
},
|
||||
"assemblyscript": {
|
||||
"version": "0.10.0",
|
||||
"resolved": "https://registry.npmjs.org/assemblyscript/-/assemblyscript-0.10.0.tgz",
|
||||
"integrity": "sha512-ErUNhHboD+zsB4oG6X1YICDAIo27Gq7LeNX6jVe+Q0W5cI51/fHwC8yJ68IukqvupmZgYPdp1JqqRXlS+BrUfA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"binaryen": "93.0.0-nightly.20200514",
|
||||
"long": "^4.0.0"
|
||||
}
|
||||
},
|
||||
"binaryen": {
|
||||
"version": "93.0.0-nightly.20200514",
|
||||
"resolved": "https://registry.npmjs.org/binaryen/-/binaryen-93.0.0-nightly.20200514.tgz",
|
||||
"integrity": "sha512-SRRItmNvhRVfoWWbRloO4i8IqkKH8rZ7/0QWRgLpM3umupK8gBpo9MY7Zp3pDysRSp+rVoqxvM5x4tFyCSa9zw==",
|
||||
"dev": true
|
||||
},
|
||||
"long": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz",
|
||||
"integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
}
|
||||
18
docs/assemblyscript-hello-world/package.json
Normal file
18
docs/assemblyscript-hello-world/package.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"name": "wasi-hello-world",
|
||||
"version": "1.0.0",
|
||||
"description": "Hello world in Wasi with AS and as-wasi",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"build": "asc wasi-hello-world.ts -b wasi-hello-world.wasm -t wasi-hello-world.wat --runtime half",
|
||||
"wasmtime": "wasmtime wasi-hello-world.wasm"
|
||||
},
|
||||
"author": "Aaron Turner",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"assemblyscript": "^0.10.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"as-wasi": "^0.1.1"
|
||||
}
|
||||
}
|
||||
5
docs/assemblyscript-hello-world/wasi-hello-world.ts
Normal file
5
docs/assemblyscript-hello-world/wasi-hello-world.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import "wasi"
|
||||
|
||||
import {Console} from "as-wasi"
|
||||
Console.log('Hello World!\n');
|
||||
|
||||
Reference in New Issue
Block a user