Standard library

mu keeps the host builtin surface small and grows capability through mu-written modules.

Three layers

  1. Host builtins (Go)
    • A tiny, fixed set like len, append, error, type, inspect, syscall, buf, and dlcall.
  2. Prelude helpers (mu)
    • Injected globals like println, panic, test, and exit.
  3. Namespaced modules (mu)
    • Import explicitly and call helpers behind a namespace, e.g. strings.split.

Key modules

Example

import "strings"
import "sys"

line := "  hello,mu  "
trimmed := strings.trim(line)
sys.stdout_write(trimmed)

Guidelines

The stdlib stays small, composable, and explicit. New helpers should return errors as values and avoid hidden global state.

See docs/StdlibGuidelines.md for the detailed conventions.

Next steps