AssemblyScript is a programming language created in 2017.
git clone https://github.com/AssemblyScript/assemblyscript
#497on PLDB | 6Years Old |
A TypeScript-like language for WebAssembly.
/** Calculates the n-th Fibonacci number. */
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
}