Welcome to EZ! This tutorial will guide you through writing your first programs.
Create a file named hello.ez and add:
out "Hello, World!"
Run it: ./ez hello.ez
Declared implicitly by assignment.
name = "User"
age = 20
when age >= 18 {
out name + " is an adult."
} other {
out name + " is a minor."
}
Defined with task. Use give to return values.
task greet(name) {
give "Hello " + name
}
out greet("Alice")
Use repeat for counting.
repeat i = 1 to 3 {
out "Count: " + str(i)
}
Arrays and Dictionaries are first-class citizens.
todos = ["Code", "Sleep"]
push(todos, "Eat")
get item in todos {
out "- " + item
}
Run heavy operations without blocking.
task difficultMath() {
stop(1000) # Simulating work
give 42
}
out "Starting..."
future = spawn(difficultMath)
out "Working..."
result = await(future)
out "Result: " + str(result)