writeonce/runtime/src
shoney.arickathil ac134c9a3b feat(compiler): query order-by + take (9b cont.)
- `order by <field> [desc]` on whole-row queries: a selection sort over
  the result multi, re-reading the key per element via the range var
  (DB_GET_FIELD); O(n^2), KISS, no cost planner — the result sets are
  small by design
- Text order keys use a new WO_B_STR_LT builtin (content compare, reusing
  the WO_B_SORT elem_cmp); scalar keys use the LT opcode. The bug this
  fixes: op_lt on two Text pointers compares ADDRESSES
- `take N`: clamp to count, slice [0,N). `take` is the KwTake keyword,
  not an Ident — matched as the token
- two bugs found + fixed while testing: multi-line query clauses (skip
  the separating newlines) and the key-kind read (must bind the range
  var BEFORE ty_of_expr of the order key, or a Text key silently uses
  op_lt); Index typechecks to the container's element type (`ds[0]`)
- fixture run/db-query-order; oop-e2e 75/0, woc-test 566/0, 15 runtime
  suites, log-watcher 7/0
- employee `seed`/`list`/`staff` modes now compile and run; report
  (group-by+projection), raise (update), drop (delete) remain

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-16 05:20:17 +02:00
..
.gitkeep feat(runtime): wovm VM core (Iteration 2) 2026-08-10 09:35:55 +02:00
borrow.c feat(runtime): wovm VM core (Iteration 2) 2026-08-10 09:35:55 +02:00
borrow.h feat(runtime): wovm VM core (Iteration 2) 2026-08-10 09:35:55 +02:00
builtin.c feat(compiler): query order-by + take (9b cont.) 2026-08-16 05:20:17 +02:00
builtin.h fix: a stopping program stops (executable plan, Task 4) 2026-08-14 23:58:21 +02:00
CODE-LOGIC.md docs: status board on the compile-and-run milestone + CODE-LOGIC beside the code 2026-08-14 17:20:59 +02:00
cont.c feat(runtime): wovm VM core (Iteration 2) 2026-08-10 09:35:55 +02:00
cont.h feat(runtime): wovm VM core (Iteration 2) 2026-08-10 09:35:55 +02:00
gc.c feat(runtime): wovm VM core (Iteration 2) 2026-08-10 09:35:55 +02:00
gc.h feat(runtime): wovm VM core (Iteration 2) 2026-08-10 09:35:55 +02:00
json.c fix: close per request, soak the daemon, kill five soak-found leaks (Tasks 5+6) 2026-08-15 00:32:49 +02:00
loader.c feat(compiler): query order-by + take (9b cont.) 2026-08-16 05:20:17 +02:00
loader.h feat: secondary indexes + @unique trap (iteration 9, Task 4; wob v3) 2026-08-15 12:57:32 +02:00
main.c feat: insert executes (iteration 9, Task 3) -- DB_STUB retires for insert 2026-08-15 11:15:06 +02:00
obj.c fix: copy-on-push closes the container double-free; line-buffer program output 2026-08-14 18:50:18 +02:00
obj.h feat: insert executes (iteration 9, Task 3) -- DB_STUB retires for insert 2026-08-15 11:15:06 +02:00
sysio.c fix: a stopping program stops (executable plan, Task 4) 2026-08-14 23:58:21 +02:00
vm.c fix: a stopping program stops (executable plan, Task 4) 2026-08-14 23:58:21 +02:00
vm.h fix: a stopping program stops (executable plan, Task 4) 2026-08-14 23:58:21 +02:00
wob.h feat(compiler): query order-by + take (9b cont.) 2026-08-16 05:20:17 +02:00