AssemblyScript is a programming language created in 2017.
#377on PLDB | 7Years Old |
git clone https://github.com/AssemblyScript/assemblyscript
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
}