Documentation
Host scripts & REPL
Evaluate pure Walnut on your Mac without building an iOS app.
| Command | Behavior |
|---|---|
walnut run <file.walnut> | Typecheck, compile, run main, print the result |
walnut repl | Interactive expressions; ↑↓ history in ~/.walnut/repl_history |
:help | List REPL commands |
:type <expr> | Typecheck only |
:load <path> | Load a .walnut module into the session |
:reload | Re-read loaded files from disk |
:quit / :q | Exit |
iOS apps still use walnut simulator / walnut device — the REPL does not host UIKit, Cmd, or Sub.
Script vs app main
Only script programs run on the host: a value-producing main, not Walnut.sandbox / Walnut.element. App programs print a hint to use the simulator instead.
Requirements
Homebrew installs llvm with the walnut formula. If you built the CLI yourself, install LLVM (brew install llvm) or set LLVM_HOME.
Related
- Toolchain — CLI commands
- Getting started — REPL walkthrough