A general-purpose, statically typed systems programming language. It is designed for verbose, accurate code and fast execution.
Thrust simplifies C and C++ APIs in a way that is easier to explain, and it integrates compiler control and common conveniences directly into the language.
Important
The compiler is in an early development phase and has not made its major releases yet. Some edge cases still need handling, and the compiler is under constant testing and fuzzing.
You can install the latest compiler toolchain through Torio, the main Thrust compiler-controller and package manager for the language.
Repository: https://github.com/thrustlang/torio
If you don't want to build the project from scratch, check the available versions on GitHub releases.
Thrust Compiler - GitHub Releases
Supported platforms and architectures:
| Platform | Architecture | Release tag |
|---|---|---|
| Linux Ubuntu GNU | x64 x86_64-unknown-linux-gnu |
thrustc-x86_64-linux-ubuntu-v*.*.* |
| Windows MSVC | x64 x86_64-pc-windows-msvc |
thrustc-x86_64-windows-msvc-v*.*.* |
| macOS Apple Silicon | aarch64 aarch64-apple-darwin |
thrustc-aarch64-macos-v*.*.* |
| macOS Intel | x64 x86_64-apple-darwin |
thrustc-x86_64-macos-v*.*.* |
The compiler depends on the LLVM compiler infrastructure.
Automatically:
$ git clone --depth=1 https://github.com/thrustlang/compiler-dependency-builder
$ cd compiler-dependency-builder
$ cargo build --release
$ ./target/release/compiler-dependency-builderAnother way:
$ git clone --depth=1 https://github.com/thrustlang/compiler-dependency-builder
$ cd compiler-dependency-builder
$ cargo run For a high-level view of the command line, see Compiler Dependency Builder - Commands & Flags.
Clone the repository and enter it:
$ git clone --depth=1 https://github.com/thrustlang/thrustc
$ cd thrustcSome Cargo and rustc dependencies need additional libraries.
Install each Cargo dependency automatically:
sh scripts/cargo-dependencies.shfish scripts/cargo-dependencies.fishscripts\cargo-dependencies.bat.\scripts\cargo-dependencies.ps1You need Rust installed with a recent version.
- >= Rust (v1.85.0)
- Rust 2024 Edition
Build the compiler with Rust:
$ cargo build --release
$ ./target/release/thrustc --helpThrust Compiler supports cross-compilation like Clang.
./thrustc main.thrust my_library.thrust \
-target-triple riscv64-unknown-linux-gnu \
-cpu sifive-u74 \
-opt O3 ./thrustc main.thrust my_library.thrust \
-target-triple wasm32-unknown-unknown \
-opt O3 You can target macOS, Windows, Linux, and other platforms from your current system without switching machines.
For a high-level view of the command line, see Thrust Compiler - Commands & Flags.
The Thrust language syntax is documented in the Thrust Syntax repository.
For editor integration through the Language Server Protocol, especially for Visual Studio Code, see Thrust LSP - Visual Studio Code.
The compiler's structure is described in Thrust Programming Language - Compiler Structure.
See Thrust Programming Language - Contributing for how to contribute to the compiler.
The Rust code structure in the compiler is documented at Thrust Programming Language - Rust Code Documentation.
The command line shortcuts available across Rust and Cargo are listed in Thrust Programming Language - Cargo Alias.
See Thrust Programming Language - Commit Conventions for the commit conventions to follow when delivering a GitHub commit.
Examples of the compiler diagnostics you can find in thrustc are in Thrust Programming Language - Compiler Diagnostics.
See Thrust Programming Language - Compiler Fuzzing for how to fuzz the compiler with stable and unstable features.
See Thrust Programming Language - Compiler Releasing for how a new compiler version is released.
The code of conduct for project contributors is in Thrust Programming Language - Code of Conduct.
Thrust Compiler is distributed under the terms of the GNU General Public License (version 3). See LICENSE.txt file for details.


