A small programming language designed to be kind β explicit, predictable, and gentle on the brain.
Luma was built for people who want to focus on what they're building, not fight their tools. Every design decision prioritizes clarity over cleverness.
- No hidden magic β everything is visible and explicit
- Predictable behavior β what you see is what you get
- Kind errors that explain how to fix problems, not just that something broke
- Low cognitive load β consistent patterns, minimal punctuation noise
- Multiple errors at once β never stop at the first problem and leave you guessing
void main() {
int x = 5;
string name = "Luma";
if x > 3 {
print("x is greater than 3");
}
for i in range(1, 4) {
write("&{i}... ");
}
while x > 0 {
print("&{x} remaining");
x -= 1;
}
print("Hello, &{name}!");
}
- Explicit types β
int x = 5;,string name = "Luma";,bool done = false; - No sigils β just clear, readable keywords
- String interpolation β
"Hello, &{name}!"just works - For loops β
for i in range(1, 10) { ... } - Match statements with integer, range, and wildcard patterns
- User-defined functions with typed parameters and return values
- Logical operators β
&&,||, andnot - Compound assignments β
+=,-=,*=,/= - Remainder operator β
x % y - Negative literals β
-42,-3.14 - Proper block scoping β variables don't leak outside their block
- Kind error messages β source snippets, pointers, fix suggestions, and common-mistake hints
- Warnings for unused variables with actionable hints
- Debug levels β
--debug basic,--debug verbose,--debug trace - Fast β runs simple programs in ~200 microseconds
Luma's errors are designed to be friendly, not terse:
[E001] Error: Missing semicolon
ββ[ main.lm:3:14 ]
β
3 β int x = 5
β β
β β°β Suggestion: Add a semicolon at the end of this statement.
ββββ―
Luma also recognizes common mistakes from other languages:
[E002] Error: I don't know what 'println' means here
ββ[ main.lm:2:5 ]
β
2 β println("hello");
β β
β β°β Luma uses print() β it already adds a newline automatically.
ββββ―
Warnings use [?] instead of [!] so they feel less alarming:
[?] Warning: Unused variable: 'x'
ββ[ main.lm:2:9 ]
β
2 β int x = 5;
β β
β β°β If you meant to ignore it, prefix with underscore: _x
ββββ―
An interactive install script is coming soon. Watch this repo for updates.
# Run a Luma file
luma run main.lm
# Check for errors without running
luma check main.lm
# Create a new project
luma new myproject
# Show execution time
luma run main.lm --time
# Enable debug output
luma run main.lm --debug basic
luma run main.lm --debug verbose
luma run main.lm --debug traceA Luma project looks like this:
myproject/
βββ lm/
β βββ main.lm
βββ README.md
| Type | Example |
|---|---|
int |
int x = 42; |
float |
float pi = 3.14; |
string |
string name = "Luma"; |
bool |
bool done = false; |
# Void function β no return value
void greet(string name) {
print("Hello, &{name}!");
}
# Typed function β returns a value
int add(int x, int y) {
return x + y;
}
void main() {
greet("world");
int result = add(3, 4);
print(result);
}
# If / else if / else
if x > 10 {
print("big");
} else if x > 5 {
print("medium");
} else {
print("small");
}
# While loop
while x > 0 {
x -= 1;
}
# For loop
for i in range(1, 6) {
print(i);
}
# Break out of a loop
while true {
if done {
break;
}
}
# Match statement
match x {
1:
print("one");
range(2, 5):
print("two to five");
_:
print("something else");
}
# Arithmetic
x + y x - y x * y x / y x % y
# Comparison
x == y x != y x > y x < y x >= y x <= y
# Logical
x && y x || y not x
# Compound assignment
x += 1 x -= 1 x *= 2 x /= 2
# Negative literals
int n = -42;
float f = -3.14;
| Function | Description |
|---|---|
print(value) |
Print a value followed by a newline |
write(value) |
Print a value without a newline |
read() |
Read a line from stdin |
int(value) |
Convert to integer |
float(value) |
Convert to float |
string(value) |
Convert to string |
random(min, max) |
Random integer between min and max (inclusive) |
string name = "world";
int count = 42;
print("Hello, &{name}! Count is &{count}.");
use math;
Full import system and standard library coming soon.
Luma is in active early development. It works, but some features are still being built.
- β Lexer, parser, AST, interpreter
- β
All four primitive types (
int,float,string,bool) - β Variable declarations with type checking
- β Proper block scoping
- β If / else if / else
- β While loops
- β
For loops with
range() - β Break statement
- β Match statements with integer, range, and wildcard patterns
- β User-defined functions with typed params and return values
- β String interpolation
- β
Compound assignments (
+=,-=,*=,/=) - β
Remainder operator (
%) - β Negative number literals
- β
Logical operators (
&&,||,not) - β String equality and comparison
- β
Built-in functions (
print,write,read,int,float,string,random) - β Kind error and warning system with common-mistake hints
- β
usekeyword (stub β imports coming soon) - β
CLI (
run,check,new,--time,--debug)
- π² Method chaining (
.) - π² Extension methods (
int.squared(),string.shout()) - π²
maybe()type with.or()for optional values - π² New types (
char,list,table) - π² Standard library (
math,io, etc.) - π² Import system +
luma.toml
Luma was built by someone who struggles to write code independently due to disabilities affecting reading, mathematics, focus, and cognitive load. Working with AI tools made building a language possible β but it also made clear how important predictable, explicit design is.
Luma is for anyone who finds programming languages overwhelming. It won't surprise you. It won't judge you. It'll tell you exactly what went wrong and how to fix it.
See CONTRIBUTING.md or visit github.com/dylanisaiahp.
MIT β see LICENSE.