aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar zinc <zinc@downsta.ir> 2026-10-14 09:57:20 +0000
committerGravatar zinc <zinc@downsta.ir> 2026-10-14 09:57:20 +0000
commit6b483e06eaafd126a188bb3756949c2fff48c8c4 (patch)
treeeb3da928472d94c7c423b36c49997796daf7e5d5
parentMerge branch 'worktree-agent-ac140cf83750c2604' into ccr-0054c02e-dfdvnd (diff)
todo: tick the spec; list the bugs its appendix b found
-rw-r--r--TODO.md3
1 files changed, 2 insertions, 1 deletions
diff --git a/TODO.md b/TODO.md
index 31e30fe..3a1e348 100644
--- a/TODO.md
+++ b/TODO.md
@@ -156,7 +156,7 @@ the final full suite stays at the very end whatever its size.
- [ ] `std.capture.end` writes its terminator at `rt.outbuf[rt.outn]`; when more than 256 characters were captured, `outn` equals the capacity and the 0 lands one word past the buffer. check and fix, with a regression program.
- [ ] a bare call to a sibling static function inside a struct's method (`lim()` for a static `lim`) reports `lim is used but never defined`; resolve it like the bare struct constants now are.
- [x] packed byte strings and `u`/`m`/`d` in zc0: match the self-hosted compiler's `bstr` support, and treat `u`, `m`, `d` as ordinary names (a recast is the letter directly followed by `*`; tags are accepted and ignored), keeping zc0's genome image byte-identical.
-- [ ] write `docs/SPEC.md`, the language specification, from the self-hosted compiler as the reference, with the zc0 subset marked and every disagreement between prose and code listed.
+- [x] write `docs/SPEC.md`, the language specification, from the self-hosted compiler as the reference, with the zc0 subset marked and every disagreement between prose and code listed.
- [ ] verify both compilers against `docs/SPEC.md` with a fresh agent: one test program per rule, run on both, every deviation reported and triaged.
- [x] a `make parity` runner that compiles the zc0-compatible programs (and the genome sources) with zc0 and with the self-hosted compiler, runs both images and compares output, so the two front ends can't disagree silently again (the `&&`/`||` precedence bug). (`src/tools/parity.sh`, `make parity`; by-design differences in `tests/parity.known`.)
- [x] c typedefs: `typedef T name;` declares a type alias, including pointer, array and function types, usable everywhere a type is, shown in hovers.
@@ -166,6 +166,7 @@ the final full suite stays at the very end whatever its size.
- [ ] zc0 has no `?:`; add it so parity covers conditional expressions, and grow zc0's subset where it is cheap (structs and enums are the largest group of programs parity skips today).
- [ ] remaining zc0 gaps: string literals over 4095 bytes, `embed` of an array type inside a function, `x as T` with more than a single name (`x as int*`), and zc0 silently accepting `.u` on a parameter where the self-hosted compiler rejects it; also `docs/history/43-stdlib/notes.md` still says zc0 reserves u/m/d (a history note: add a pointer forward rather than rewriting it).
- [ ] a run-only image accepts `void main()` from zc0 but the self-hosted compiler rejects it against `run.zc`'s `int main();` prototype; make the two agree.
+- [ ] fix the implementation bugs listed in `docs/SPEC.md` appendix b (after the verifier confirms them): `memdebug scrub;` rejected; enum members can't reference earlier members; a plain function redefinition silently shadows the first; a prototype after the definition hides it; `?:` with one int and one float branch gives garbage; `bool` not normalised; float global initializers rejected; a global initializer naming another global uses its address; `include std;` inside a function body; syntax-error recovery hiding later errors; unterminated `/*` and string literals; `x as int * y`; prototypes needing parameter names; `len(char*)` with typecheck off; duplicate `case` labels; local `const` in constant expressions; constant expressions without precedence (`1+2*3` is 9). also make zc0's integer literals match (`010`, overflow) and fix the prose items the appendix lists.
- [ ] continue removing `unchecked` from the remaining runtime boundaries by teaching the analyzer the missing ownership and drop contracts; document any irreducible low-level escapes. the compiler, standard library and lsp no longer disable checking for their functions. status, from a trial that was reverted: with `unchecked` removed, `copy_w` and `fill_w` pass the analyzer once their gate stores go through `syscall(SYS_COPY, ...)`, `dgrow` once `w[-2] = it` becomes `own(w, it)`, `dpush` once `own(x, h[2])` comes before the store, and `dnew` as is. but the checked versions changed run-time behavior: 7 of the 87 program checks in `tests/test.sh` failed (closure cells, the proved-loop bounds check) and `tests/programs/share.zc` hung with a checked `cons`. so checked code in these functions inserts cleanup the runtime can't afford, and each one needs its contract taught to the analyzer, not just a rewrite that compiles. `free`, `recycle`, `recycle_leaf` and `gc` are the allocator and collector that the analyzer's own cleanup calls, so they stay unchecked and need to be documented as the irreducible escapes. `src/lib/actor.zc` has about 20 more.
- [ ] document the public standard-library apis with concise descriptions of behavior, parameters, ownership and return values where applicable; update reference and learning entries, add executable examples and record implemented changes in history; keep prose lowercase and verify docs appear in hovers.
- [ ] revise diagnostics, comments and learning/reference prose using professional compiler documentation guidance, preserving lowercase and adding message regressions.