Skip to content
@thrustlang

Thrust Programming Language

A general-purpose, statically typed systems programming language for writing verbose, accurate, and fast code.

Thrust Programming Language logo

Thrust Programming Language

A general-purpose, statically typed systems programming language for writing verbose, accurate, and fast code.

Source files use the .thrust extension.

Compiler | Downloads | Website Source | Roadmap

separator

Philosophy

Thrust gives low-level machine control like C, while still letting you reach for higher-level abstractions when needed.

New features are designed to keep the same mental model: if you can reason about C, you can reason about Thrust.

The language favors explicit code, predictable behavior, and readable systems programming over hidden runtime machinery.

Language Features

  • C-style clarity: explicit locals, direct control flow, predictable value and branch behavior.
  • Generics at compile time: generic functions and structures with explicit instantiation and no runtime generic overhead.
  • C interoperability: direct interop through @extern, @convention("C"), variadic declarations, and raw pointer boundaries.
  • Compile-time conditionals: @if, @elif, and @else for platform-specific code selection.
  • Useful imports: std:: modules, aliases, selective imports, and file imports without hiding dependencies.
  • Built-in compile helpers: sizeOf, alignOf, typeWidth, pointerWidth, isSameType, staticAssert, and compiler metadata helpers.
  • Cross-platform targets: build for Linux, Windows, macOS, RISC-V, WebAssembly, and other backend-supported targets.

Compiler Capabilities

  • Standalone Ahead-Of-Time (AOT) compilation.
  • Just-In-Time (JIT) compilation via -jit.
  • LLVM backend with broad target support.
  • System V ABI support and NVIDIA CUDA ABI work.
  • Sanitizers, stack protection, and DWARF debug information.
  • Diagnostics tooling and fuzzing coverage.
  • Editor support for VS Code, Sublime Text, and Neovim.

Experimental And Advanced Areas

  • CUDA / NVPTX: GPU kernels compiled to PTX and launched through CUDA tooling.
  • Inline assembly: asmfn, asm, and global_asm for architecture-specific code.
  • C header integration: importC work for importing C declarations.

These areas are useful for low-level and platform-specific work, but they are expected to evolve as the language matures.

Example

import std::io;

fn fibonacci[T](n: T) T @public {
    if n <= 0 { return 0; }
    if n == 1 { return 1; }

    var a: T = 0;
    var b: T = 1;
    var i: T = 2;
    var result: T = 0;

    while i <= n {
        result = a + b;
        a = b;
        b = result;
        i++;
    }

    return result;
}

fn main() s32 @public {
    var result: s32 = fibonacci[s32](10);
    io::print("fib(%d) = %d\n", 10, result);
    return 0;
}

Getting Started

Prebuilt compiler binaries are available in the thrustc releases for Linux x64, Windows x64, and macOS x64/ARM64.

Linux

./thrustc fibonacci.thrust -cc-args="-o fibonacci" && ./fibonacci

Windows

.\thrustc.exe fibonacci.thrust -cc-args="-o fibonacci.exe" && .\fibonacci.exe

For compiler flags and examples, see the thrustc repository.

Status

Thrust is evolving in early 0.2.x releases. The core pipeline is already in place: parsing, static type checking, LLVM code generation, JIT execution, cross-compilation, standard library snapshots, and release tooling.

The language and standard library are still young. Expect rough edges, missing pieces, and breaking changes while the project stabilizes.

Useful Repositories

Support

Contributors are welcome. Whether you are new to systems programming or experienced with low-level tooling, there is room to help with language design, compiler work, documentation, examples, tests, and editor support.

Spanish speakers are especially welcome.

Social Networks

Discord

separator

Always Remember

~ "It takes a long time to make a tool that is simple and beautiful." ~ Bjarne Stroustrup (C++ Programming Language creator)

Pinned Loading

  1. thrustc thrustc Public

    A general-purpose, statically typed systems programming language

    Rust 35 4

  2. torio torio Public

    A package manager and compiler-controller.

    Rust 3 1

Repositories

Showing 10 of 13 repositories
  • .github Public

    Resource/assets center for the whole project.

    thrustlang/.github's past year of commit activity
    1 GPL-3.0 0 0 0 Updated Sep 9, 2026
  • website Public

    Thrust Programming Language - Official documentation and language reference

    thrustlang/website's past year of commit activity
    Python 0 GPL-3.0 0 0 0 Updated Sep 8, 2026
  • llvm-project Public Forked from llvm/llvm-project

    The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.

    thrustlang/llvm-project's past year of commit activity
    LLVM 1 18,911 0 0 Updated Sep 9, 2026
  • thrustc Public

    A general-purpose, statically typed systems programming language

    thrustlang/thrustc's past year of commit activity
    Rust 35 GPL-3.0 4 0 0 Updated Sep 8, 2026
  • syntax Public

    Speculative syntax for the Thrust Programming Language.

    thrustlang/syntax's past year of commit activity
    2 GPL-3.0 0 0 0 Updated Sep 6, 2026
  • roadmap Public

    Thrust programming language's roadmap

    thrustlang/roadmap's past year of commit activity
    1 GPL-3.0 0 0 0 Updated Aug 5, 2026
  • compiler-dependency-builder Public

    This small tool builds the necessary dependencies for the compiler and places them where they are needed for the compiler to be built.

    thrustlang/compiler-dependency-builder's past year of commit activity
    Rust 1 GPL-3.0 0 0 0 Updated Aug 5, 2026
  • lld-wrapper Public

    LLVM Linker (LLD) wrapper in Rust.

    thrustlang/lld-wrapper's past year of commit activity
    C++ 1 GPL-3.0 0 0 0 Updated Aug 1, 2026
  • toolchains Public

    x86_64 (libc, musl, glibc, msvcrt, libcmt) Windows & Linux precompiled LLVM and Clang infrastructure.

    thrustlang/toolchains's past year of commit activity
    Batchfile 2 GPL-3.0 0 0 0 Updated Aug 1, 2026
  • torio Public

    A package manager and compiler-controller.

    thrustlang/torio's past year of commit activity
    Rust 3 GPL-3.0 1 0 0 Updated Aug 1, 2026