Proxam is a programming language implementation for my programming exam. It's written from the bottom up in Rust, and uses rustc's LLVM API for code generation.
More documentation will come later since this is far from finished.
Check spec.md
for the current specification I'm aiming to implement.
Currently the following features are implemented:
- Function definitions & declarations
- Type system
- Arithmetic operation
- Function calls ( current partial application is not implemented )
- If-expressions
- Let-binding
I'm currently working on getting type parameters implement ( generics ) and traits. Which will make compile-time partially applied function passing and closures possible using generics. The type system is bare bones ( There's only a few usable types in the language, though it can easily support more ) currently since I'm working on language semantics and not completeness.
Currently correct LLVM-IR is being generated, but optimization passes and native code generation is yet to be moved inside the compiler.
Currently you need to compile the code using the nightly version of Rust and Cargo. The compiler will spit out the llvm IR, which can be compiled to any llvm supported target using llc
.
; Naïve Fibonacci implementation
; Defined in rt.c
def print_int x : Int -> ()
def fib x : Int -> Int =
if x < 2
then 1
else (fib x - 1) + (fib x - 2)
def main : () =
let a : Int = 3
in print_int (fib a * a)