| @@ -2,7 +2,7 @@ |
| 2 | 2 | |
| 3 | 3 | > **Status: Proposed, 2026-10-09.** It gathers everything v0 deferred, from the [v0 plan](roadmap.md), the [v0 release notes](release-notes-v0.md), the ADRs and the follow-up issues. The definition of done and the milestone order are proposals for the project owner. Per Innoptech policy, each milestone's runtime, type-system and architecture decisions get an ADR and engineering review before they are built. |
| 4 | 4 | > |
| 5 | | −> Tracked in issue #52 (the v1 epic); milestones #44–#51. |
| 5 | +> Tracked in issue #52 (the v1 epic); milestones #44–#51 (#50 deferred to v2), #61 (speed) and #62 (cleanliness). |
| 6 | 6 | |
| 7 | 7 | ## Where v0 ended |
| 8 | 8 | v0 met its definition of done (issue #13): a supervised HTTP server with SSR HTML, argon2 over C FFI, effect handlers for logging and a mockable DB, and an LSP. |
| @@ -15,25 +15,26 @@ These v0 limitations have been addressed since the v0 release notes (M6, PRs #37 |
| 15 | 15 | - rest_for_one; |
| 16 | 16 | - `spawn_link` and `spawn_monitor` as single operations. |
| 17 | 17 | |
| 18 | | −Since then, the first v1 work has merged (PRs #54–#59): |
| 18 | +Since then, the first v1 work has merged (PRs #54–#60): |
| 19 | 19 | - the benchmark suite; |
| 20 | 20 | - the runtime's own context switch; |
| 21 | 21 | - per-thread run queues with work stealing; |
| 22 | 22 | - `Bytes` and HTTP keep-alive; |
| 23 | 23 | - the Perceus optimisations; |
| 24 | | −- mimalloc and `#line` directives. |
| 24 | +- mimalloc and `#line` directives; |
| 25 | +- a real-time clock once a socket opens, so HTTP idle timeouts expire under load. |
| 25 | 26 | |
| 26 | 27 | The milestone issues track what is left. |
| 27 | 28 | |
| 28 | 29 | ## v1 definition of done (proposed) |
| 29 | | −**The v0 demo, made production-shaped.** It runs on all cores with work stealing, is measurably fast on a benchmark suite, speaks binary HTTP/1.1 with keep-alive, and has an interactive page rendered on the client from the same HTML literals. It installs its dependencies from a registry. |
| 30 | +**The v0 demo, made production-shaped.** It runs on all cores with work stealing, compiles and runs measurably fast on a benchmark suite, and speaks binary HTTP/1.1 with keep-alive. Its dependencies come from git with a lockfile. Its code meets Innoptech's quality bar. |
| 30 | 31 | |
| 31 | 32 | Concretely: |
| 32 | 33 | - [ ] Every accepted v1 ADR is implemented, and every proposed v0 ADR has been reviewed. |
| 33 | 34 | - [ ] `tests/bench` exists. Each performance milestone states its target on it, and meets it. |
| 34 | 35 | - [ ] The demo serves keep-alive HTTP with `Bytes` bodies, on several threads, under a load test, with the leak oracle at 0. |
| 35 | | −- [ ] One page of the demo runs client-side (wasm or JS), typed with the same `Element<msg>`. |
| 36 | | −- [ ] `tilc` resolves dependencies from a registry (or git) with a lockfile. |
| 36 | +- [ ] `tilc` resolves git dependencies with a lockfile. |
| 37 | +- [ ] The cleanliness audit's high-priority findings are fixed, or recorded as decisions (#62). |
| 37 | 38 | |
| 38 | 39 | ## Milestones |
| 39 | 40 | |
| @@ -41,14 +42,32 @@ Concretely: |
| 41 | 42 | |---|---|---|---| |
| 42 | 43 | | M0 | Review gate | Engineering review of the still-proposed ADRs: 0010 (lexical handlers), 0003 Rev. 2 (unwinding in C), 0005 Rev. 1 (extern convention), 0002 Rev. 1 (regions, move/share/copy), 0004 Rev. 1 and its implementation notes (threads, `Send` check). | #44 | |
| 43 | 44 | | M1 | Runtime foundations | The runtime's own context switch (x86_64, aarch64; macOS if cheap), replacing corosensei and its `Send` wrapper. mimalloc behind `tl_alloc`. Scheduler step 2: per-thread queues with work stealing, lock-free mailboxes, an atomic actor state, loom models, per-thread timer wheels, ThreadSanitizer. | #45 (#35, #43) | |
| 44 | | −| M2 | Fast code | A benchmark suite first. Perceus: borrow inference, reuse (FBIP), drop specialisation. Static dictionaries, then specialisation of known trait evidence. A decision (ADR) on monomorphisation versus uniform boxed values for numeric code. A "never unwinds" analysis that drops yield checks after leaf calls. | #46 (#34) | |
| 45 | +| M2 | Fast code (closed; the rest moved to #61) | A benchmark suite first. Perceus: borrow inference, reuse (FBIP), drop specialisation. Static dictionaries, then specialisation of known trait evidence. A decision (ADR) on monomorphisation versus uniform boxed values for numeric code. A "never unwinds" analysis that drops yield checks after leaf calls. | #46 (#34) | |
| 45 | 46 | | M3 | Data and IO | `Bytes` with a builder, shared when large. `std/net` on `Bytes`, with UTF-8 validation for strings. HTTP keep-alive, chunked bodies and binary responses. Arrays (`TL_SCAN_LARGE`, reserved in the ABI). Bigint promotion on `Int` overflow (an ABI change). | #47 (#36) | |
| 46 | 47 | | M4 | FFI and the C boundary | Callbacks from C into tilcayo. A binding generator for simple C signatures (bindgen-style). `#line` directives in generated C, which need spans in Core, so that C compiler and sanitizer errors point at `.til` lines. | #48 (#35) | |
| 47 | 48 | | M5 | Language | Multi-shot resumptions (v0 resumptions are one-shot). Traits with several parameters, higher-kinded types, user-defined derives (ADR 0007). User-level `finally` (ADR 0003: unwinding runs drops only). The interpreter matching native on escaped continuations (a `resume` after its handler finished panics in both). | #49 | |
| 48 | | −| M6 | Client HTML target | Compile to wasm or JS. `ctl` without fibers, by Koka-style continuation capture on top of yield-bubbling (ADR 0003's planned path). Typed `on*` event attributes and `msg` dispatch (ADR 0009). A client runtime for `Element<msg>`. | #50 | |
| 49 | | −| M7 | Packages and tooling | A package registry, or git dependencies with a lockfile first. Incremental analysis on salsa if the LSP needs it (ADR 0006's criteria). | #51 | |
| 49 | +| M7 | Packages and tooling | Git dependencies with a lockfile. Incremental analysis on salsa if the LSP needs it (ADR 0006's criteria). | #51 | |
| 50 | +| Speed | Compile time and runtime | Per-phase compile timings and a compile-time benchmark, then the hotspots. The monomorphisation ADR, specialisation of known trait evidence, the never-unwinds analysis (from M2), and the runtime's hot paths. | #61 | |
| 51 | +| Cleanliness | SOLID, DRY, KISS, cohesion and coupling | An audit of every crate, the runtime and `std` (`docs/code-health.md`), then behaviour-preserving refactors after the feature work merges. | #62 | |
| 50 | 52 | |
| 51 | | −Suggested order: M0 first, then M1 and M2 in parallel (M2's benchmarks first), then M3. M4–M7 can start whenever their ADRs are accepted. M6 depends on M5's decision on multi-shot resumptions, because it changes how continuations are captured. |
| 53 | +Order (2026-10-09): M1, M3, M4, M5, M7 and Speed run in parallel, each with its ADR proposed and added to M0's review list. The cleanliness audit runs now, and its refactors run after the feature work merges. |
| 54 | + |
| 55 | +**ADR numbers reserved** for the parallel work: |
| 56 | +- 0013: monomorphisation and specialisation. |
| 57 | +- 0014: arrays and bigint. |
| 58 | +- 0015: C callbacks and bindings. |
| 59 | +- 0016: `finally` and escaped continuations. |
| 60 | +- 0017: multi-shot resumptions. |
| 61 | +- 0018: multi-parameter traits and HKT. |
| 62 | +- 0019: user-defined derives. |
| 63 | +- 0020: git dependencies and the lockfile. |
| 64 | + |
| 65 | +Timer wheels and ThreadSanitizer are ADR 0004 Revision 4. |
| 66 | + |
| 67 | +## Deferred to v2 |
| 68 | +Tracked in #63: |
| 69 | +- **The client HTML target** (formerly M6, #50): wasm or JS, `ctl` without fibers, typed `on*` attributes, a client runtime for `Element<msg>`. It will build on M5's multi-shot resumptions. |
| 70 | +- **A package registry.** v1 ships git dependencies with a lockfile. |
| 52 | 71 | |
| 53 | 72 | ## Research, not committed to v1 |
| 54 | 73 | - **Optional `borrow` annotations or explicit lifetimes**, as a performance tool (ADR 0002). Combining them with effect handlers is research-level. |