Lucy Compiler
September 23, 2025 ยท View on GitHub
Caution
Unfinished project
Description
This is a compiler written in C3.
Key features
*for more readability and less guessing. the compiler automatically links with everything specified in the files to remove need to figure out what to link with and manually link it
Code Example
pkg main;
ext void printf(str fmt, var str args);
struct Person
{
Name name;
int age;
}
struct Name
{
str first_name;
str last_name;
}
def void main()
{
var Person p =
{
{
"Kiana",
"Bennett"
},
22
};
printf("Hello, %s!", p.name.first_name);
}
Supported systems
| Name | Tested |
|---|---|
| aarch64 | |
| aarch64_be | |
| aarch64_32 | |
| arm | |
| armb | |
| thumb | |
| thumbeb | |
| riscv32 | |
| riscv64 | |
| x86 | |
| x86_64 | |
| xcore |
Building and Running
Prerequisites
- C3 compiler installed (available from c3-lang.org)
- libLLVM 20 (available from releases.llvm.org)
Building the Compiler
c3c build -l LLVM
Using the Compiler
./build/lucy compile <file_name.lc>
./<file_name>
# Show help message
./build/lucy --help
you don't have to specify linked libraries like this, it's fully optional but recommended for readability and simplicity. you can remove the link options at the top of the file and run this instead
lucy compile main.lc -lraylib
Contributing
Contributions are welcome! Please submit pull requests or open issues for any bugs or feature requests.