Core language

Functions and calls

Define functions with let, call them normally, and use let rec for recursion.

What

Functions are values you can bind, pass, and call.

Why

This gives a direct way to organize repeated logic without relying on special syntax blocks.

How

Call named functions like usual value calls, then define recursion in the same surface with let rec.

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);
let rec loop (x : Int) : Int :=
  case x of (
  | 0 => 0
  | _ => loop(x - 1)
  );

When

Use recursion for traversals, accumulations, and simple parsers when a loop is not needed.

Analogy

Like defining a helper in Python and calling itself from its own body, but in one value-binding style.

Try it

Bind and call a function, then add the recursive form and continue to Imports and packages.