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

Same small task across four languages. Musi keeps it as an expression-oriented let binding.

Musi functions are ordinary bindings, so the syntax stays close to other definitions.

let twice (x : Int) : Int := x + x;

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.