Phase 6. Strings and I/O
| Field | Value |
|---|---|
| MEP | MEP-45 §Phases · Phase 6 |
| Status | NOT STARTED |
| Started | — |
| Landed | — |
| Tracking issue | — |
| Tracking PR | — |
Gate
Strings + stdlib I/O fixture suite (~40 cases: utf-8 iteration, slicing, concat, format, file read, file write, stdin read) compiles + runs byte-equal vs vm3 on host triple.
Goal-alignment audit
To be written before sub-phase 6.0 starts. Strings + I/O is how a program talks to the outside world; without them most realistic Mochi programs do not run. Aligns.
Sub-phases
| # | Scope | Status | Commit | PR |
|---|---|---|---|---|
| 6.0 | mochi_str: immutable utf-8 slice; short-string optimisation (≤15 bytes inline); precomputed BLAKE3-trimmed hash | NOT STARTED | — | — |
| 6.1 | +, len, [i], contains, startsWith, endsWith, split, join, toUpper/toLower via utf8proc | NOT STARTED | — | — |
| 6.2 | print, println, format-string interpolation ("{name} is {age}") | NOT STARTED | — | — |
| 6.3 | File I/O: readFile, writeFile, lines, appendFile; stdin, stdout, stderr handles | NOT STARTED | — | — |
| 6.4 | simdutf utf-8 validation on read; rejected input raises MOCHI_ERR_PARSE | NOT STARTED | — | — |
Decisions made
Fill in along the way.
Deferred work
Locale-aware collation: v2 (utf8proc default order is enough for v1).
Closeout notes
Fill in after gate green.