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.
A general-purpose, statically typed systems programming language for writing verbose, accurate, and fast code.
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.
Direct executable links from GitHub Releases.
./thrustc fibonacci.thrust -cc-args="-o fibonacci" && ./fibonacci
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);
// Expected result: fib(10) = 55
io::print("fib(%d) = %d\n", 10, result);
return 0;
}
A familiar C-style mental model with explicit, predictable behavior for systems programming.
Generic functions and structures with explicit instantiation and no runtime generic overhead.
Direct interop with C code via @extern and @convention("C").
Use @if, @elif, and @else to select platform-specific code at compile time.
Build for Linux, Windows, macOS, RISC-V, WebAssembly and more from one machine.
Type/layout builtins like sizeOf, alignOf, and isSameType for safer code.