A step-by-step introduction to Goop. Each chapter links to runnable examples checked by CI (goop check).
| Chapter | Topic | Example |
|---|---|---|
| 1. Getting started | Build, check, first program, REPL, show Go | hello.goop, gallery |
| 2. Types and patterns | ADTs, match, branded IDs |
shapes.goop |
| 3. Errors and effects | result, failwith, effect handlers |
result.goop, effects.goop, exceptions.goop |
| 4. Go / C interop | import go, @[go], @[c] |
extern_demo.goop, cgo_demo.goop, gallery |
| 5. Concurrency | go, chan, ref, race checks |
concurrency.goop, race_detection.goop |
| 6. Safety checks | Exhaustiveness, branding, refinements | branded_ids.goop, trading_order.goop |
| 7. Arrays and loops | Array.make, for/while, begin/end |
arrays.goop, trading_decision_lut.goop |
| 8. Maps | map[K] V, Map.* |
maps.goop |
Try online: Playground
# Install release binary, or build from source:
curl -fsSL https://raw.githubusercontent.com/Macho0x/Goop/main/scripts/install.sh | bash
# — or —
cd src && go build -o ../goop ./cmd/goop
goop new hello && cd hello
goop check main.goop- VS Code: install from a GitHub Release
.vsixoreditors/vscode— syntax highlighting,.goopfile icon, LSP - Zed:
cd editors/zed && make install - Neovim: see
editors/neovim - Helix: see
editors/helix - GitHub: interim F# highlighting via
.gitattributes; full Goop highlighting after Linguist submission
- Style guide (1.0)
- Syntax reference
- Type system
- Maps (
map[K] V) - CLI artifacts —
goop doc, cache layout - Writing tools — files + maps via
import go - Sample apps:
http_hello.goop,cli_files.goop - Packages and registry (1.0) — Go modules +
goop get; no separate registry - Benchmarks — generated vs hand Go (indicative)
- Standard library reference
- All examples
- Playground