AssemblyScript
- AssemblyScript/assemblyscript
- Apache-2.0
- TypeScript-like language for WebAssembly
- 参考
export function fib(n: i32): i32 {
var a = 0,
b = 1;
if (n > 0) {
while (--n) {
let t = a + b;
a = b;
b = t;
}
return b;
}
return a;
}
asc fib.ts --outFile fib.wasm --optimize