Build and run
Talor compiles to LLVM IR and native binaries. The compiler is self-hosted: a seed compiler builds the compiler written in Talor, and that compiler builds itself to a byte-identical fixpoint.
What you need
- clang, and the LLVM it belongs to. The compiler writes IR through LLVM's own library, so the clang that assembles it has to be of the same vintage.
- make and ar.
- One of the supported targets: Linux or macOS on
x86_64oraarch64, or Windows onx86_64oraarch64.
Build the compiler
sh
git clone <repository-url> Talor
cd Talor
make stage1The result is build/stage1/talor-stage1, the self-hosted compiler.
Hello, Talor
Write this to hello.talor:
talor
fn main(): i32 {
println(`hello, Talor`);
0
}main returns (), i32 or i64; an integer it returns is the exit code. The shortest path from source to behavior is run:
sh
build/stage1/talor-stage1 run hello.talormake install puts the compiler on your PATH as talor, in ~/.local/bin unless PREFIX says otherwise, and then talor run hello.talor works from any directory. To keep the IR, compile it:
sh
build/stage1/talor-stage1 compile hello.talor -o hello.llEditor support
sh
make install-vscodeinstalls the editor extension, which ships the same TextMate grammar this documentation highlights code with.
Where next
- The five-minute tour walks the whole language in one program.
- Learn covers each concept at its own pace.