Commit Graph

122 Commits

Author SHA1 Message Date
fc2baee9c7 lua: loadstring returns compiled fn (errors propagate cleanly); parse-fail → (nil, err)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-24 21:12:12 +00:00
12b02d5691 lua: table.sort insertion-sort → quicksort; 30k sort.lua still timeouts (interpreter-bound)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-24 21:02:33 +00:00
57516ce18e lua: dostring alias + diagnosis notes; keep grinding scoreboard
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-24 20:53:36 +00:00
46741a9643 lua: Lua 5.0-style arg auto-binding in vararg functions; assert-counter diagnostic +2 tests
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-24 20:44:39 +00:00
1d3a93b0ca lua: loadstring wraps transpiled AST in (let () …) to contain local definitions
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-24 20:35:18 +00:00
f0a4dfbea8 lua: if/else/elseif body scoping via (let () …); else-branch leak fixed +3 tests
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-24 20:26:20 +00:00
54d7fcf436 lua: do-block proper lexical scoping (wrap in (let () …)) +2 tests
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-24 20:19:01 +00:00
d361d83402 lua: scoreboard iter — trim whitespace in lua-to-number (math.lua past arith-type)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-24 20:11:31 +00:00
0b0d704f1e lua: scoreboard iter — table.getn/foreach/foreachi + string.reverse (sort.lua unblocked past getn)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-24 20:04:45 +00:00
5ea81fe4e0 lua: scoreboard iter — return; trailing-semi, collectgarbage/setfenv/getfenv/T stubs; all runnable tests reach execution
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-24 19:57:24 +00:00
781bd36eeb lua: scoreboard iter — trailing-dot numbers, stdlib preload, arg/debug stubs (8x assertion-depth)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-24 19:49:32 +00:00
743e0bae87 lua: vararg ... transpile (spreads in call+table last pos); 6x transpile-unsup fixed +6 tests
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-24 19:38:22 +00:00
cf4d19fb94 lua: scoreboard iteration — rawget/rawset/raweq/rawlen + loadstring/load + select/assert + _G/_VERSION
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-24 19:29:08 +00:00
24fde8aa2f lua: require/package via package.preload +5 tests
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-24 19:19:36 +00:00
582894121d lua: os stub (time/clock/date/difftime/getenv/...) +8 tests
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-24 19:14:00 +00:00
c6b7e19892 lua: io stub (buffered) + print/tostring/tonumber +12 tests
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-24 19:07:31 +00:00
40439cf0e1 lua: table library (insert/remove/concat/sort/unpack) +13 tests
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-24 19:00:18 +00:00
6dfef34a4b lua: math library (abs/trig/log/pow/min/max/fmod/modf/random/...) +17 tests
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-24 18:53:28 +00:00
8c25527205 lua: string library (len/upper/lower/rep/sub/byte/char/find/match/gmatch/gsub/format) +19 tests
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-24 18:45:03 +00:00
a5947e1295 lua: coroutines (create/resume/yield/status/wrap) via call/cc +8 tests
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-24 18:36:41 +00:00
0934c4bd28 lua: generic for-in; ipairs/pairs/next; arity-tolerant fns +9 tests
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-24 18:23:50 +00:00
e224fb2db0 lua: pcall/xpcall/error via guard+raise; arity-dispatch lua-apply +9 tests
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-24 18:05:35 +00:00
43c13c4eb1 lua: metatable dispatch (__index/__newindex/arith/cmp/__call/__len) +23 tests
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-24 17:57:27 +00:00
4815db461b lua: scoreboard baseline — 0/16 runnable (14 parse, 1 print, 1 vararg)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-24 17:43:33 +00:00
3ab8474e78 lua: conformance.sh + Python runner (writes scoreboard.{json,md})
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-24 17:37:09 +00:00
d925be4768 lua: vendor PUC-Rio 5.1 test suite (22 .lua files)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-24 17:29:01 +00:00
418a0dc120 lua: raw table access — mutating set!, len via has-key?, +19 tests
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-24 17:23:39 +00:00
fe0fafe8e9 lua: table constructors (array/hash/computed/mixed/nested) +20 tests
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-24 17:17:35 +00:00
2b448d99bc lua: multi-return + unpack at call sites (+10 tests)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-24 17:10:52 +00:00
8bfeff8623 lua: phase 3 — functions + closures (+18 tests)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-24 16:57:57 +00:00
99753580b4 Recover agent-loop progress: lua/prolog/forth/erlang/haskell phases 1-2
Salvaged from worktree-agent-* branches killed during sx-tree MCP outage:
- lua: tokenizer + parser + phase-2 transpile (~157 tests)
- prolog: tokenizer + parser + unification (72 tests, plan update lost to WIP)
- forth: phase-1 reader/interpreter + phase-2 colon/VARIABLE (134 tests)
- erlang: tokenizer + parser (114 tests)
- haskell: tokenizer + parse tests (43 tests)

Cherry-picked file contents only, not branch history, to avoid pulling in
unrelated ocaml-vm merge commits that were in those branches' bases.
2026-04-24 16:03:00 +00:00
e274878052 HS-plan: log cluster 29 blocked
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 15:50:22 +00:00
a3d1c37c95 HS-plan: scoreboard — cluster 29 blocked, C=4 done + 1 blocked
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 15:47:25 +00:00
2b486976a6 HS-plan: mark cluster 29 blocked
sx-tree MCP file ops broken this session (Yojson Type_error "Expected
string, got null" on every file-based call — sx_read_subtree,
sx_find_all, sx_replace_by_pattern, sx_summarise, sx_pretty_print, even
sx_load_check on existing files works but summarise fails). Can't edit
integration.sx to add before:init/after:init dispatch. Additionally 4
of the 6 tests fundamentally require stricter parser error-rejection
(add - to currently parses to (set! nil ...); on click blargh end
accepts blargh as symbol expression) — out of single-cluster budget.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 15:46:55 +00:00
6e92a5ad66 HS-plan: claim cluster 29 hyperscript:before:init events
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 15:31:52 +00:00
2cd8e57694 HS-plan: log cluster 19 (pick regex + indices) done +13
Cluster 19 was implemented in 4be90bf2 but the plan/scoreboard rows
still marked it pending. Sync the plan state: mark done, add log entry,
bump merged total 1264 → 1277.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 15:31:11 +00:00
0f67021aa3 plans: briefings + roadmaps for lua, prolog, forth, erlang, haskell
Five new guest-language plans mirroring the js-on-sx / hs-loop pattern, each
with a phased roadmap (Progress log + Blockers), a self-contained agent
briefing for respawning a long-lived loop, and a shared restore-all.sh that
snapshots state across all seven language loops.

Briefings bake in the lessons from today's stall debugging: never call
sx_build (600s watchdog), only touch lib/<lang>/** + own plan file, commit
every feature, update Progress log on each commit, route shared-file
issues to Blockers rather than fixing them.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 15:16:45 +00:00
d865c4d58d HS: plan/scoreboard — fill in SHA 6c1da921 for cluster 28 2026-04-24 14:08:29 +00:00
6c1da9212a HS: ask/answer + prompt/confirm mock (+4 tests)
Wire up the `ask` and `answer` commands end-to-end:

- tokenizer.sx: register `ask` and `answer` as hs-keywords.

- parser.sx: cmd-kw? gains both; parse-cmd dispatches to new
  parse-ask-cmd (emits `(ask MSG)`) and parse-answer-cmd, which
  reads `answer MSG [with YES or NO]`. The with/or pair reads
  yes/no via parse-atom — parse-expr would collapse
  `"Yes" or "No"` into `(or "Yes" "No")` before match-kw "or"
  could fire. The no-`with` form emits `(answer-alert MSG)`.

- compiler.sx: three new cond branches (ask, answer, answer-alert)
  compile to a let that binds __hs-a, sets `the-result` and `it`,
  and returns the value — so `then put it into ...` works.

- runtime.sx: hs-ask / hs-answer / hs-answer-alert call
  window.prompt / confirm / alert via host-call + host-global.

- tests/hs-run-filtered.js: test-name-keyed globalThis.{alert,
  confirm,prompt}; __currentHsTestName is updated before each
  test. Host-set! for innerHTML/textContent now coerces JS
  null → "null" (browser behaviour) so `prompt → null` →
  `put it into #out` renders literal text "null", which the
  fourth test depends on.

Suite hs-upstream-askAnswer: 1/5 -> 5/5.
Smoke 0-195: 166/195 -> 170/195.
2026-04-24 14:08:25 +00:00
30fca2dd19 HS: plan/scoreboard — fill in SHA d7a88d85 for cluster 25 2026-04-24 13:54:52 +00:00
d7a88d85ae HS: parenthesized commands and features (+1 test)
Three parser additions so scripts like `(on click (log me) (trigger foo))`
parse into a single feature with both commands in its body:

1. parse-feat: new cond branch for `paren-open` — advance, recurse
   parse-feat, consume `paren-close`. Allows a feature like `(on click
   ...)` to be grouped in parens.

2. parse-cmd: two new cond branches — on `paren-close` return nil (so
   cl-collect terminates at an outer group close), and on `paren-open`
   advance / recurse / close. Allows single parenthesized commands like
   `(log me)`.

3. cl-collect: previously only recursed when the next token was a
   recognised command keyword (`cmd-kw?`), so after `(log me)` the
   sibling `(trigger foo)` would end the feature body and re-surface as
   a top-level feature. Extended the recursion predicate to also fire
   when the next token is `paren-open`.

Suite hs-upstream-core/parser: 9/14 -> 10/14.
Smoke 0-195: 165/195 -> 166/195.
2026-04-24 13:53:36 +00:00
6a4269d327 plan: Blocker — SX number promotion narrows floats to ints 2026-04-24 12:21:22 +00:00
ec0be48a00 plan: progress log session 4 — 147/300 (49%), harness cache + 6 features 2026-04-24 12:20:25 +00:00
dc97c17304 js-on-sx: Blockers — Math trig primitives + evaluator CPU bound
Two shared-file entries based on scoreboard patterns:

- Math trig/transcendental primitives missing. 34× "TypeError: not a
  function" across Math category — sin/cos/tan/asin/acos/atan/atan2,
  sinh/cosh/tanh/asinh/acosh/atanh, log/log2/log10/log1p/expm1,
  clz32/imul/fround, variadic hypot/max/min. All need OCaml/JS platform
  primitives; can't polyfill from pure SX and keep precision. Once
  present in the runtime, `js-global.Math` gets one extension and all 34
  failures flip together.

- Evaluator CPU bound at ~1 test/s on 2-core box. Runner already
  auto-disables parallel workers on ≤2 cores. Optimization surface for
  the shared evaluator: lexical addresses (vs name walk), inline caches
  on js-get-prop (vs __proto__ walk), force-JIT transpiled JS bodies
  (vs lazy), OCaml 5 domains (vs separate processes).

Progress-log entry for P0 harness cache added alongside.
2026-04-24 11:21:58 +00:00
f14a257533 HS-plan: note sx pretty-print cherry-pick footgun + surgical re-apply workaround 2026-04-24 11:04:06 +00:00
5875c97391 HS-plan: log cluster 20 landed (c932ad59, worktree re-apply) 2026-04-24 11:03:35 +00:00
4cc2e82091 HS-plan: log cluster 27 landed (0c31dd27, worktree re-apply) 2026-04-24 10:44:43 +00:00
1473e277fd HS-plan: log cluster 26 landed (304a52d2, worktree cherry-pick) 2026-04-24 10:14:12 +00:00
99c5911347 HS-plan: log cluster 30 landed (64bcefff, worktree cherry-pick) 2026-04-24 10:08:18 +00:00
eb587bb3d0 plan: progress log — session 3 continued, 100/cat scoreboard 114/300 2026-04-24 09:57:17 +00:00