An open API service indexing awesome lists of open source software.

https://github.com/thrushlang/thrushc

The Thrush Programming Language. A programming language dedicated to creating maintainable and modular software.
https://github.com/thrushlang/thrushc

aot-compiler c clang code-generation compiler hechoencostarica jit-compilation language llvm opensource programming-language rust thrush thrushlang

Last synced: 10 months ago
JSON representation

The Thrush Programming Language. A programming language dedicated to creating maintainable and modular software.

Awesome Lists containing this project

README

          


logo

> [!WARNING]
> **The compiler is still under development and is unfinished, please be peaceful if exists some bug.**

# The Thrush Compiler

The Thrush Compiler is tasked with converting Thrush source code (`.th`) into native code for each architecture, using either Just In Time (**JIT**) or Ahead Of Time (**AOT**) compilation modes, leveraging the LLVM infrastructure (**LLVM-C API**) during the process.

# ¿How it works?

Currently, the only backend available for the thrush compiler to compile is the current LLVM, using the LLVM-C API. The process consists of three parts:

1. Compilation by thrushc to LLVM bitcode (*.bc).
2. Optimization by the LLVM optimization tool (opt & llvm-lto).
3. Final compilation by clang to the target.

In summary:



## Build dependencies

**Important Rust crates:**

- **llvm-sys** (v170)
- **inkwell** (v0.50)

## Requirements for creating optimal binaries

### Linux Toolchain

- [Linux Toolchain (x64)](https://github.com/thrushlang/toolchains/releases/download/Toolchains/thrushlang-toolchain-llvm-linux-x64-v1.0.2.tar.xz)

> [!NOTE]
> The language will contain a **pre-optimized** toolchain repository for each operating system. This process automates the installation of the language and its entire ecosystem through the **Thorium** package manager.