First real program compiled with Valeri #

I've reached my first significant milestone with Valeri. It can now compile something useful to bytecode and then execute it in the virtual machine.

As an example, I've implemented a simple recursive factorial function:

(fn fact (n)
    (if (<= n 0)
        1
        (* n (fact (- n 1)))))
(fact 12)

If you save this code as factorial.vli, you can then run it with ./vli factorial.vli, and it will give you 479001600, as you would expect.

This may not seem impressive at a first glance, but to compile this example the compiler has to support: