Skip to content
thrustlangPublic

About

A general-purpose, statically typed systems programming language

Topics

Resources

Code of conduct

Contributing

Stars

36 stars

Watchers

1 watching

Forks

Latest commit

 

History

1,120 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

logo

Thrust Programming Language

standard-separator

A general-purpose, statically typed systems programming language. It is designed for verbose, accurate code and fast execution.

What problem does it solve?

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.

Getting started

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.

Torio

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

torio toolchain install

Prebuilt binaries

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*.*.*

From scratch

Build dependencies

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-builder

Another 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 thrustc

Build Cargo/rustc dependencies

Some Cargo and rustc dependencies need additional libraries.

Install each Cargo dependency automatically:

Bash

sh scripts/cargo-dependencies.sh

Fish

fish scripts/cargo-dependencies.fish

CMD

scripts\cargo-dependencies.bat

PowerShell

.\scripts\cargo-dependencies.ps1

Build the compiler

You 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 --help

Cross compilation

Thrust Compiler supports cross-compilation like Clang.

RISC-V 64-bit

./thrustc main.thrust my_library.thrust \
  -target-triple riscv64-unknown-linux-gnu \
  -cpu sifive-u74 \
  -opt O3 

WebAssembly

./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.

Commands and flags

For a high-level view of the command line, see Thrust Compiler - Commands & Flags.

Language syntax

The Thrust language syntax is documented in the Thrust Syntax repository.

Language server

For editor integration through the Language Server Protocol, especially for Visual Studio Code, see Thrust LSP - Visual Studio Code.

Compiler structure

The compiler's structure is described in Thrust Programming Language - Compiler Structure.

Contributing

See Thrust Programming Language - Contributing for how to contribute to the compiler.

Rust code documentation

The Rust code structure in the compiler is documented at Thrust Programming Language - Rust Code Documentation.

Cargo alias

The command line shortcuts available across Rust and Cargo are listed in Thrust Programming Language - Cargo Alias.

Commit conventions

See Thrust Programming Language - Commit Conventions for the commit conventions to follow when delivering a GitHub commit.

Compiler diagnostics

Examples of the compiler diagnostics you can find in thrustc are in Thrust Programming Language - Compiler Diagnostics.

Compiler fuzzing

See Thrust Programming Language - Compiler Fuzzing for how to fuzz the compiler with stable and unstable features.

Compiler releasing

See Thrust Programming Language - Compiler Releasing for how a new compiler version is released.

Code of conduct

The code of conduct for project contributors is in Thrust Programming Language - Code of Conduct.

License

Thrust Compiler is distributed under the terms of the GNU General Public License (version 3). See LICENSE.txt file for details.

About

A general-purpose, statically typed systems programming language

Topics

Resources

Code of conduct

Contributing

Stars

36 stars

Watchers

1 watching

Forks

Releases

Sponsor this project

Used by

Contributors

Languages