Start
First program
Write a small file and read it as expressions.
Musi files are read as expressions. A file is executed from top to bottom as a sequence.
What
This page teaches the smallest runnable surface: values, bindings, and simple expressions.
let answer := 42;
answer;Why
Short files are the fastest way to learn language behavior without project scaffolding. You can spot how names and results flow before layering packages, effects, or classes.
How
Use let for values and end each expression with ;. After a value exists, the next expression can use it.
Compare
static int twice(int x) {
return x + x;
}
int answer = twice(21);let twice (x : Int) : Int := x + x;
twice(21);fn twice(x: i32) -> i32 {
x + x
}
let answer = twice(21);function twice(x: number): number {
return x + x;
}
const answer = twice(21);The next snippet introduces a reusable function and direct call style.
When
Use this pattern for notes, toy utilities, and onboarding examples before you add package config.
Analogy
Think like Python or JavaScript REPL cells: each statement creates a value, and later statements can use earlier results.
Try it
Define the two snippets above, evaluate with music, then move to Files, packages, and entry.
musi-lang.com