LearnCore Syntax

Core Syntax

Build comfort with literals, operators, ranges, functions, calls, and methods.

Core Syntax is where Musi starts to feel like a language you can use without pausing at every line. The chapters here cover the everyday expression surface: literals, tuples, operators, ranges, functions, lambdas, calls, and dot calls.

Read this part as a sequence of small reading skills, not as a grammar checklist. A literal is a value written directly. A tuple groups a few values by position. An operator makes a common operation compact. A range names a span. A function gives a reusable action a boundary. A call shows where that action receives real inputs.

Real programs mix these pieces constantly. A booking app might compare dates, format a person's name, call a pricing function, and return a confirmation record. A game might compute a range of legal moves and call a helper for each one. A store might use a lambda to format every receipt line.

The danger in core syntax is not difficulty; it is density. A line can become hard to read long before it becomes hard for the compiler. When that happens, name the intermediate value. Musi code should make value flow visible enough that an editor, formatter, and person all agree on the shape.

By the end of this part, ordinary expressions should feel boring in a good way. You should know when to write a direct expression, when to name a helper, and when a call site is becoming too crowded.