Functions
fibonacci-test

The big test:

    check(
        \\fn fib(n: i64) i64 {
        \\    var a: i64 = 0;
        \\    var b: i64 = 1;
        \\    var i: i64 = 0;
        \\    while (i < n) {
        \\        var t: i64 = a + b;
        \\        a = b;
        \\        b = t;
        \\        i = i + 1;
        \\    }
        \\    return b;
        \\}
        \\fib(10)
    , 89);

If this prints ok 89 -- congratulations. You have a programming language. It handles arithmetic with precedence, typed variables, mandatory-brace if/else, while loops, and functions with typed parameters and return values. All from a string. All in one Zig file.

Stop and think about that for a second. The fib function calls itself conceptually (through the while loop and variable manipulation), and our save/restore mechanism keeps everything straight. We started 27 problems ago with eval("7") returning 7. Now we have Fibonacci. That's a real distance.