This project is a result of learning the innards of compilers. Among other compiler books that I learned from, this was the most influential, especially in making this project: Writing an Interpreter In Go.
To use the Monna interpreter, simply run go run main.go
in the project directory.To get an executable, run go build
in the project directory.
let x = 5;
return 5;
return false;
if (x < y) { x }
if (x > y) { y } else { x }
fn(x, y) { x + y; }
"Hello World"
- len(): Returns the number of characters in a string.
len("Dexter's Laboratory");
19
- puts(): Prints the given arguments to STDOUT. It return a null. It only cares about printing not returning a value.
puts("Sugar, spice, and everything nice!");
Sugar, spice, and everything nice!
The Monna programming language also responds accordingly to errors: