You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A compiled systems programming language that targets LLVM IR. Lucis combines the performance and control of C with modern syntax, user-defined generics, a rich standard library, and native C interoperability — with zero runtime overhead.
namespace Main;
use std::log::println;
fn main() int32 {
println("Hello, world!");
ret 0;
}
Native compilation — LLVM backend targeting x86-64, ARM, and more; full optimization pipeline (-O1 through -O3, -Os, -Oz, -Ofast) and Link Time Optimization (--lto)
C FFI — call any C function with extern, include headers with #include, pass structs by value; zero glue code
User-defined generics — monomorphized struct Node<T>, extend Node<T> methods, generic functions fn max<T>(T a, T b) T, and type inference from call arguments when possible
Built-in collections — vec<T>, map<K, V>, set<T> with full method suites
Note for Static Linkage (--static):
If you plan to use the --static flag, you must also install the static library versions for system dependencies:
Ubuntu/Debian: zlib1g-static
Arch Linux: zlib-static
Fedora: zlib-static
(Ensure glibc-static is also installed on Fedora/RedHat based systems)
Configure and build (recommended)
Use the project Makefile (portable wrappers around CMake):
git clone https://github.com/CarlosDlw/Lucis.git
cd Lucis
make configure BUILD_TYPE=Debug SANITIZERS=ON
make build
The compiled binary is at build/lucis.
Useful configure variants:
# Release build without sanitizers
make configure BUILD_TYPE=Release SANITIZERS=OFF
# Force Ninja generator
make configure GENERATOR="Ninja"# Pass extra CMake hints (custom prefixes/toolchains)
make configure CMAKE_FLAGS="-DCMAKE_PREFIX_PATH=/opt/custom"
lucis init [path] Create a new project
lucis build <file> [-o <out>] [-O <lvl>] [--lto] [--emit-...] Compile to binary
lucis run <file> [-O <lvl>] [--lto] [-- args...] JIT execution
lucis check <file> [-I <dir>] Type-check only
lucis test [filter] [-q] Run test suite
lucis help [command] Show help
lucis helpc <lib> [symbol] C library reference
# Compile to binary with LTO and size optimization
lucis build main.lc -o ./main -Oz --lto
# Emit Assembly to file
lucis build main.lc --emit-asm -o main.s
# Show LLVM IR in terminal
lucis build main.lc --emit-llvm
# Run via JIT with O3 optimization
lucis run main.lc -O3
# Type-check only
lucis check main.lc
# Run the test suite
lucis test -q
Quick Example
namespace Main;
use std::log::println;
struct Node<T> {
T value;
}
extend Node<T> {
fn create(T val) Node<T> {
ret Node<T> { value: val };
}
fn getValue(&self) T {
ret self.value;
}
}
fn max<T>(T a, T b) T {
ret a > b ? a : b;
}
fn main() int32 {
Node<int32> n = Node::create(42);
int32 val = n.getValue();
int32 m = max(3, 7);
println(val); // 42
println(m); // 7
ret 0;
}