Skip to content

lucy-language/lucy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lucy Compiler

Caution

Unfinished project

Description

This is a compiler written in C3.

Key features

  • in-file linker options*

  • package- or module-like structure

  • simple syntax

*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 False
aarch64_be False
aarch64_32 False
arm False
armb False
thumb False
thumbeb False
riscv32 False
riscv64 False
x86 False
x86_64 True
xcore False

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.

About

Compiled toy language rewritten in C3

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages