A compiler for a simple turing complete programming language written in c++. The language at hand is called 'ni' and is a statically typed interpreted language.
$ ./build.sh
$ ./main [input.ni]
Ni follows a simple c-like syntax with a couple of adjustments.
fun main(): void {
print_line("Hello, World");
}
var x = 23;
x = x * x;
print_line(#string x);
var text = "Hello";
var firt_char = text[0];
var text_length = text.length;
var xs = [1,2,3];
var first_element = xs[0];
xs[1] = 5;
var list_length = xs.length;
var x: int = 23;
var y: float = 23.5;
var z: char = 'H';
var a: string = "Hello, World";
var b: [int] = [1,2,3];
fun add(x: int, y: int): int {
return x + y;
}
fun main(): void {
var a = 23;
var b = 2 * a;
var c = add(a,b);
}