Global Variables
bug-globals-revealed

Run this test:

    check("var x: i64 = 42; fn get() i64 { return x; } get()", 42);

It prints FAIL got=0 want=42. The function get() can't see x.

Why? Look at call_fn, line by line. When we call get():

1. Save all variables: save_vn[0][0] = "x", save_vv[0][0] = 42
2. Set num_vars = 0 -- wipe the entire variable table
3. Bind parameters (none for get)
4. Execute body: return x; -> getVar("x") -> no variables! Returns 0.
5. Restore: put x = 42 back

The function can't see x because call_fn hides it. Every function starts with a blank slate -- it can only see its own parameters and local variables. That was fine for fib(10) where everything is passed as parameters. But the self-hosted compiler has global state -- src_pos, out_pos, src_len -- shared across dozens of functions. Without globals, the compiler is impossible.

We need two kinds of variables: locals (saved and restored on each function call, like now) and globals (visible everywhere, never saved or restored).