GLang was built with one mission: empower beginners. But we didn’t stop there. We also focused on speed, reliability, and a clean developer experience. Every design decision we made helps new programmers stay in control, understand their code, and build cool stuff fast.
Immutable Data
In GLang, everything is immutable. That means once you create a value, you can’t change it; you can only make a new one.
obj my_list = [1, 2, 3];
obj my_list = push(my_list, 4);
Why? Because it puts you in control. No sneaky changes, no side-effects. Every time you "modify" something, you know exactly when and how it's rebuilt. Your data stays safe and predictable, and bugs become way easier to track down.
Limited Types
GLang keeps it simple with just three core types:
number
string
list
That’s it. No booleans, no objects, no fluff.
bark(true); # output: 1
bark(false); # output: 0
Even modules like std_hashmap are just clever lists:
fetch std_hashmap;
obj hm = hashmap();
bark(hm); # output: []
By reducing complexity, GLang makes you the architect. You’re free to build your own abstractions and stay focused on what matters - the logic.
Functions Over Classes
GLang doesn’t do classes or structs. Everything is powered by good old functions.
func Car() {
give "Car";
}
obj car = Car();
Why? Because OOP can be a big, confusing mess for beginners. We’d rather start simple. If you know how functions work, you can build anything.
Whole Imports
No private variables. No cherry-picking functions. GLang uses whole imports to keep things transparent and easy to manage.
fetch std_format;
obj string = format("{}", 123);
Beginners shouldn’t have to guess what's being imported. With fetch, you bring in everything from a module, just like grabbing the whole toolbox.
Helpful Errors
GLang doesn't just yell at you when something breaks; it helps you fix it.
error: something went wrong!
in: example.glang:0:0
+
|
| broken_code
| ^^^^^^^^^^^
|
+ - > help: remove this broken code
process finished with exit code -1
Our error messages are inspired by Rust’s famously helpful compiler. We want to build you up, not break your spirit.