Calculator

Our first programming language is a simple calculator supporting addition and subtraction. This is perhaps the simplest language that helps us introducing the major topics from grammar to compilation and virtual machine.

If you haven't cloned the GitHub repo already, please do and navigate to the calculator subdirectory.

To start, we have 1 + 1; in examples/simple.calc where you can compile with

cargo build --bin main // create a simple executable for Calc
../target/debug/main examples/simple.calc

or simply

cargo run --bin main examples/simple.calc