Overview

Map C99 habits to the Musi Book without repeating every construct example.

C99 teaches you to notice layout, lifetime, pointer ownership, and linker boundaries before you trust an abstraction. Bring that suspicion to Musi, but let the source name more of the contract: imports replace header folklore, data variants replace tag comments, Option replaces null sentinels, and effects/foreign declarations mark work that leaves ordinary evaluation.

Use this guide as a translation journal for C99 code. Start with the familiar habit, then ask which Musi construct owns the same promise. A page is successful when it tells you which old instinct to keep and which old shortcut to drop.

Start from the habit that hurts

Habits that still help

  • Keep the C habit of asking where memory, symbols, and failures come from.
  • Drop the habit of encoding meaning in integer flags, comments, or pointer conventions when Musi has a type for that meaning.
  • Keep examples tied to ordinary work: receipts, routes, files, animals, people, rooms, and services.

First false friend

Musi class is not a C struct with function pointers; records/data carry shape, classes name behavior a type can provide. If you need a person, car, invoice, or package, start with records or data. If you need any type that can compare, show, encode, or step, use a class with instances.

When to switch to the Musi Book

Stay in this guide while a C99 habit is getting in the way. Switch to Values and let, Records, Patterns, Generics, Classes, and Effects when you need the source-of-truth rule.