Language Reference
This section covers the core building blocks of EZ — everything you need to write programs from simple scripts to larger applications.
What You’ll Learn
EZ is designed to be straightforward. There are no hidden tricks or complex rules to memorize. What you see is what you get.
Topics
| Topic | What it covers |
|---|---|
| Keywords | Reserved words in EZ — temp, const, do, if, etc. |
| Variables | Storing values with temp and const |
| Functions | Creating reusable blocks of code with do |
| Control Flow | Making decisions with if/otherwise and loops |
| Types | Data types — int, float, string, bool, arrays, maps |
| Structs | Grouping related data together |
| Enums | Defining a set of named values |
| Modules | Organizing code into separate files |
Where to Start
New to programming? Start with Variables, then Functions, then Control Flow. These three concepts are the foundation of almost every program.
Coming from another language? Skim through Keywords to see EZ’s syntax, then jump to whatever topic you need.
Quick Example
Here’s a small program that shows several language features:
import @std
// A struct to hold data
const Person struct {
name string
age int
}
// A function that uses control flow
do greet(p Person) {
if p.age < 18 {
std.println("Hey ${p.name}!")
} otherwise {
std.println("Hello, ${p.name}.")
}
}
do main() {
// Variables
temp people [Person] = {
Person{name: "Alice", age: 25},
Person{name: "Bob", age: 16}
}
// Loop through the array
for_each person in people {
greet(person)
}
}
Output:
Hello, Alice.
Hey Bob!
Next Steps
Pick a topic and dive in: