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

NameTested
aarch64False
aarch64_beFalse
aarch64_32False
armFalse
armbFalse
thumbFalse
thumbebFalse
riscv32False
riscv64False
x86False
x86_64True
xcoreFalse

Building and Running

Prerequisites

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.

License