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.
- Host: GitHub
- URL: https://github.com/thrushlang/thrushc
- Owner: thrushlang
- License: gpl-3.0
- Created: 2024-08-29T23:43:21.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-04-10T19:26:25.000Z (10 months ago)
- Last Synced: 2025-04-10T20:39:57.312Z (10 months ago)
- Topics: aot-compiler, c, clang, code-generation, compiler, hechoencostarica, jit-compilation, language, llvm, opensource, programming-language, rust, thrush, thrushlang
- Language: Rust
- Homepage: https://github.com/thrushlang
- Size: 3.11 MB
- Stars: 14
- Watchers: 0
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
> [!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.