Skip to content

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_64 or aarch64, or Windows on x86_64 or aarch64.

Build the compiler ​

sh
git clone <repository-url> Talor
cd Talor
make stage1

The 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.talor

make 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.ll

Editor support ​

sh
make install-vscode

installs the editor extension, which ships the same TextMate grammar this documentation highlights code with.

Where next ​

Talor v0.1.0 - Released under the MIT OR Apache-2.0 license.