Compiler for a toy programming language
Basic imperative programming, with primitive types.
fun sum(a: Int, b: Int) => Int where
return a + b;
end
fun eq(a: Double, b: Double) => Bool where
if a == b where
return True;
end
return False;
end
fun neq(a: Double, b: Double) => Bool where
return a != b;
end
While unused in the final language, there is also a type checker built including:
- Classes with multiple inheritance
- Linearizing the inheritance hierarchy
- Union and intersection types
- Optimizing type expressions
Used for generating the lexer, parser and vistor classes.
Used for code generation, builds LLVM IR and then compiles it into an binary.
Dropped it as I caught the functional programming bug, as this was initially intended to be object-oriented. Also, was looking for a reason to learn Rust, so started a new project using it, Seta