Standard library
mu keeps the host builtin surface small and grows capability through mu-written modules.
Three layers
- Host builtins (Go)
- A tiny, fixed set like
len,append,error,type,inspect,syscall,buf, anddlcall.
- A tiny, fixed set like
- Prelude helpers (mu)
- Injected globals like
println,panic,test, andexit.
- Injected globals like
- Namespaced modules (mu)
- Import explicitly and call helpers behind a namespace, e.g.
strings.split.
- Import explicitly and call helpers behind a namespace, e.g.
Key modules
sys: file descriptors, stdout/stderr helpers, read/write/open/closestrings: split/join/trim/replace and string utilitiestime: clocks and sleep helpersassert: assertions for tests and scriptsfp: functional utilities like map/filter/reducejson,path,process,sqlite,sockets,text, and more
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
- Start with the language tour if you’re new.
- Learn how the VM and native backend work in the runtime guide.
- Explore macros in macros for compile-time helpers.