A small compiled language.
l
Statically Typed and Compiled Multi-Paradigm Programming Language
curl -fsSL https://lang.cebecifaruk.com/install.sh | sh// Declares one system function and calls it with a C string.
// The final expression of a function body is its result.
extern fn puts(text: @CType("const char *")) @CType("int");
pub fn main() i32 {
puts(c"Hello World");
0
}// `if` is an expression, and a nested conditional goes in the
// `else` block; applying a type explicitly converts a value.
extern fn putchar(character: @CType("int")) @CType("int");
let CInt: Type = @CType("int");
fn calculate(operator: char, left: i32, right: i32) i32 {
if (operator == '+') { left + right } else {
if (operator == '-') { left - right } else {
if (operator == '*') { left * right } else {
if (operator == '/' && right != 0) { left / right } else { 0 }
}
}
}
}
fn print(value: i32) {
if (value >= 10) { print(value / 10) };
putchar(CInt(value % 10 + i32('0')));
}
pub fn main() i32 {
print(calculate('*', 6, 7));
putchar(CInt('\n'));
0
}// `let` binds an immutable value, so the counter lives in a
// struct field and is updated through a pointer.
extern fn puts(text: @CType("const char *")) @CType("int");
extern fn putchar(character: @CType("int")) @CType("int");
let CInt: Type = @CType("int");
fn print(value: i32) {
if (value >= 10) { print(value / 10) };
putchar(CInt(value % 10 + i32('0')));
}
pub fn main() i32 {
let counter: mut struct { value: i32 } = {value: 1};
let current: mut *i32 = counter.value;
while (*current <= 15) {
if (*current % 15 == 0) { puts(c"FizzBuzz"); } else {
if (*current % 3 == 0) { puts(c"Fizz"); } else {
if (*current % 5 == 0) { puts(c"Buzz"); } else {
print(*current); putchar(CInt('\n'));
}
}
};
current += 1
};
0
}// A slice is an immutable view of an array; a `for` loop can
// yield a value with `break` or fall through to `else`.
extern fn putchar(character: @CType("int")) @CType("int");
let CInt: Type = @CType("int");
fn print(value: i32) {
if (value >= 10) { print(value / 10) };
putchar(CInt(value % 10 + i32('0')));
}
fn average(grades: [i32]) i32 {
let cell: mut struct { total: i32 } = {total: 0};
let total: mut *i32 = cell.total;
for grade in grades { total += grade };
*total / i32(grades.length)
}
fn first_failing(grades: [i32]) i32 {
for grade in grades {
if (grade < 50) { break grade }
} else {
0
}
}
pub fn main() i32 {
let grades: [i32; 5] = [88, 72, 45, 93, 67];
print(average(grades[..]));
putchar(CInt(' '));
print(first_failing(grades[..]));
putchar(CInt('\n'));
0
}// A variant is constructed through its enum, and `switch`
// covers every one; a struct value refers to its storage.
extern fn puts(text: @CType("const char *")) @CType("int");
let Account: Type = struct { balance: i32 };
let Transaction: Type = enum {
Deposit: i32,
Withdraw: i32,
};
fn apply(account: mut Account, transaction: Transaction) bool {
switch (transaction) {
case Deposit(amount): {
account.balance += amount;
true
}
case Withdraw(amount): {
if (amount > *account.balance) { return false };
account.balance -= amount;
true
}
}
}
pub fn main() i32 {
let account: mut Account = {balance: 100};
apply(account, Transaction::Deposit(50));
apply(account, Transaction::Withdraw(30));
if (!apply(account, Transaction::Withdraw(500))) { puts(c"Insufficient funds"); };
*account.balance - 120
}§ 01
Why l?
Here are some important features of l:
AI Safety
AI can make mistakes, but a strict compiler catches them early with static types and exhaustive checks.
Multi-Paradigm
Functional programming with algebraic data types, first-class functions, and pattern matching, plus object oriented programming with methods, interfaces, and polymorphism.
Fast and Lightweight
A high performance compiled language with ahead-of-time native code, no runtime, and no garbage collector.
All-in-One Toolchain
A unified workflow for building, packaging, testing, and documentation.
Cross-Platform Support
Native builds across operating systems and architectures.
Seamless C Interoperability
Call C functions with C-compatible types and the native ABI.
Native Web Support
JavaScript and WebAssembly targets for web deployment.
§ 02
Target Audience
Here is the target audience for the language l:
Web Development
Build fast services, backends, and web-facing applications.
System Programming
Create native software with explicit control over memory and platform interfaces.
Embedded Systems
Target resource-constrained devices with predictable native code and cross-compilation.
Industrial Automation
Write deterministic control logic for PLCs, SCADA systems, and other industrial controllers.
Digital Design
Describe hardware logic for FPGAs with explicit types and compile-time evaluation instead of a separate description language.
Desktop Apps
Build native desktop software that integrates directly with platform libraries.
Mobile Apps
Share native application logic across mobile platforms and architectures.
§ 03
Start
Read the manual, or jump to the rules.