Feat: documentation, UI/UX

This commit is contained in:
2026-03-01 19:09:52 +01:00
parent ecb559e556
commit db44f9b98e
57 changed files with 1531 additions and 615 deletions

22
crates/forth/README.md Normal file
View File

@@ -0,0 +1,22 @@
# cagire-forth
Stack-based Forth VM for the Cagire sequencer. Tokenizes, compiles, and executes step scripts to produce audio and MIDI commands.
## Modules
| Module | Description |
|--------|-------------|
| `vm` | Interpreter loop, `Forth::evaluate()` entry point |
| `compiler` | Tokenization (with source spans) and single-pass compilation to ops |
| `ops` | `Op` enum (~90 variants) |
| `types` | `Value`, `StepContext`, shared state types |
| `words/` | Built-in word definitions: `core`, `sound`, `music`, `midi`, `effects`, `sequencing`, `compile` |
| `theory/` | Music theory lookups: `scales` (~200 patterns), `chords` (interval arrays) |
## Key Types
- **`Forth`** — VM instance, holds stacks and compilation state
- **`Value`** — Stack value (int, float, string, list, quotation, ...)
- **`StepContext`** — Per-step evaluation context (step index, tempo, variables, ...)
- **`Op`** — Compiled operation; nondeterministic variants carry `Option<SourceSpan>` for tracing
- **`ExecutionTrace`** — Records executed/selected spans and resolved values during evaluation