Skip to content
@thrushlang

Thrush Programming Language

A programming language dedicated to creating software that is highly adaptable to the programmer's experience.

logo

Thrush Programming Language

The Thrush Programming Language. A programming language dedicated to creating software that is highly adaptable to the programmer's experience.

Philosophy

The breach

There is currently a breach: no language focused on systems development exists that also offers easy-to-use features and a user-friendly language environment. For example:

  • Rust Complexity is inherited by the borrow checker itself, and in addition to having an advanced LLVM lifetimes system, by default it is not beginner-friendly.
  • C++ It's C++.

The Thrush solution

The programming language focuses on providing an advanced yet beginner-friendly experience while allowing for complete adaptability in certain circumstances, allowing for highly adaptable code based on the programmer's experience.

Key points for advanced programmers

  • Intrinsic manipulation of code generation.
  • Strong sublanguage, with the ability to interoperate directly with LLVM and Assembler.
  • Strongly statically typed.
  • Complex unsafe environment.
  • C interop.

Key points for beginner programmers

  • By default, a lot of good abstractions.
  • Partial memory safety environment.
  • Lightweight software (C-like).
  • Minimal runtime requirements (only the C runtime).

Example - Fibonacci sequence

Compiler (Not beginner-friendly)

Linux

mkdir build
thrushc -build-dir "build/" -llvm fibonacci.th -llvm-linker-flags "-ofibonacci;-melf_x86_64;--dynamic-linker=/lib64/ld-linux-x86-64.so.2;/usr/lib/crt1.o;/usr/lib/crti.o;/usr/lib/gcc/x86_64-pc-linux-gnu/15.
1.1/crtbegin.o;-L/usr/lib;-L/usr/lib/gcc/x86_64-pc-linux-gnu/15.1.1;-lc;/usr/lib/gcc/x86_64-pc-linux-gnu/15.1.1/crtend.o;/usr/lib/crtn.o" && ./fibonacci

Package Manager

thorium run

Code

fn print(fmt: ptr) s32 @public @ignore @extern("printf");

fn fibonacci(n: u64) u64 @alwaysinline @strongstack @hot {

    if n <= 1 {
        return n;
    }

    return fibonacci(n - 2) + fibonacci(n - 1);

}

fn main() { 

    for local i: u64 = 0; i < 10; i++; {

        local fmt: str = "fibonacci of '%ld': %ld\n";

        // Explicit pointer arithmetic.
        instr raw_fmt: ptr = load ptr, address fmt[0][0];

        // Explicit pointer arithmetic.
        print(raw_fmt, i, fibonacci(i));

    }

}

Contribute

  • If you're interested in contributing to the project and you're a Spanish speaker, let us know by visiting our official social media channels below.
  • If you already know Rust but not LLVM, we're willing to teach.

Social Media

Thrush Programming Language

Pinned Loading

  1. thrushc thrushc Public

    The Thrush Programming Language. A programming language dedicated to creating software that is highly adaptable to the programmer's experience.

    Rust 21 4

  2. thorium thorium Public

    The package manager for Thrush Programming Language.

    Rust 1

  3. toolchains toolchains Public

    Standard pre-optimized toolchains for the Thrush Programming Language.

    1

  4. syntax syntax Public

    Speculative syntax for the Thrush Programming Language.

    1

  5. quantum quantum Public

    Extending the Thrush programming language for quantum programming.

    1

Repositories

Showing 6 of 6 repositories

People

This organization has no public members. You must be a member to see who’s a part of this organization.

Top languages

Loading…

Most used topics

Loading…