Closed ammarbinfaisal closed 1 year ago
example of a program which wouldn't work because the current way is faulty
fun f(n: int) -> int {
return fib(10)
}
fun fib(n: int) -> int {
if n < 2 {
return n
}
return fib(n - 1) + fib(n - 2)
}
fun main() {
print(f(10))
}
like I am doing in bytecode generation for c vm, the calls and jumps should be patched after the entire codegen when we know the place of each function in the instruction vector.