Language tour
Each stop is a short page with one runnable sample and its verified output. The tour assumes you have a working may command; if not, start with Get started.
Published stops:
Still planned:
- Control flow and
match - Strings and interpolation in depth
OptionandResult- Closures and fibers
- Generics
- Modules and
pub Anyand dynamic code- Files and processes
- Networking
- Where to go next
Try a sample now
fun greet(name: Str) -> Str {
return "Hello, ${name}!";
}
print(greet("Maylang"));
let values: List<Int> = [1, 2, 3];
let doubled: List<Int> = map(values, fun(value: Int) -> Int {
return value * 2;
});
print(doubled);Output
Hello, Maylang!
[2, 4, 6]Five details that surprise people
- There are no hexadecimal literals. Write decimal values, or use
load8/store8for byte work. - Every path through a function must execute
return; a final expression is not an implicit return. IntandFloatcannot be compared directly. Convert one side before comparing.printalways adds a newline. Usesyscall(1, ...)only when you need raw output.lencounts code points, not bytes.
Continue to Strict typing for the rules behind these examples.