Commit Graph

326 Commits

Author SHA1 Message Date
193b0c04be erlang: list comprehensions (+12 tests)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-25 06:19:14 +00:00
e6af4e1449 smalltalk: eight-queens classic program (sizes 1/4/5 verified)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-25 06:08:46 +00:00
8e809614ba erlang: register/whereis, Phase 5 complete (+12 tests)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-25 05:43:57 +00:00
8daf33dc53 smalltalk: fibonacci classic program + smalltalk-load + 13 tests
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-25 05:35:24 +00:00
c444bbe256 smalltalk: cannotReturn: stale-block detection + 5 tests
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-25 05:11:14 +00:00
47a59343a1 erlang: supervisor one-for-one (+7 tests)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-25 05:09:41 +00:00
c7d0801850 smalltalk: ifTrue:/ifFalse: family + bar-as-binary parser fix
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-25 04:47:42 +00:00
8717094e74 erlang: gen_server behaviour (+10 tests)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-25 04:36:29 +00:00
a7272ad162 smalltalk: whileTrue:/whileFalse: family pinned + 14 tests
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-25 04:24:27 +00:00
f09a712666 smalltalk: BlockContext value family + 19 tests
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-25 04:02:00 +00:00
424b5ca472 erlang: -module/M:F cross-module calls (+10 tests)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-25 04:01:14 +00:00
c33d03d2a2 smalltalk: non-local return via captured ^k + 14 nlr tests
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-25 03:40:01 +00:00
882205aa70 erlang: try/catch/of/after, Phase 4 complete (+19 tests)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-25 03:26:01 +00:00
82bad15b13 smalltalk: super send + top-level temps + 9 super tests
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-25 03:15:39 +00:00
1a5a2e8982 erlang: exit-signal propagation + trap_exit (+11 tests)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-25 02:51:32 +00:00
45147bd8a6 smalltalk: doesNotUnderstand: + Message + 12 tests
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-25 02:49:16 +00:00
8b7b6ad028 smalltalk: method-lookup cache + 10 tests
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-25 02:23:47 +00:00
c363856df6 erlang: link/unlink/monitor/demonitor + refs (+17 tests)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-25 02:16:04 +00:00
4e89498664 smalltalk: eval-ast + 60 tests
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-25 02:01:07 +00:00
aa7d691028 erlang: ring benchmark + results — Phase 3 closed
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-25 01:41:54 +00:00
52523606a8 smalltalk: class table + bootstrap hierarchy + 54 tests
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-25 01:34:59 +00:00
e71154f9c6 smalltalk: chunk-stream parser + pragmas + 21 tests
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-25 01:11:44 +00:00
089e2569d4 erlang: conformance.sh + scoreboard (358/358 across 9 suites)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-25 01:06:23 +00:00
33ce994f23 smalltalk: expression parser + 47 parse tests
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-25 00:46:03 +00:00
1516e1f9cd erlang: fib_server.erl, 5/5 classic programs (+8 tests)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-25 00:33:18 +00:00
4e7d2183ad smalltalk: tokenizer + 63 tests
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-25 00:19:23 +00:00
51ba2da119 erlang: echo.erl minimal server (+7 tests)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-25 00:00:47 +00:00
8a8d0e14bd erlang: bank.erl account server (+8 tests)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-24 23:28:24 +00:00
0962e4231c erlang: ping_pong.erl (+4 tests)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-24 22:56:28 +00:00
2a3340f8e1 erlang: ring.erl + call/cc suspension rewrite (+4 ring tests)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-24 22:24:17 +00:00
97513e5b96 erlang: exit/1 + process termination (+9 tests)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-24 21:34:21 +00:00
e2e801e38a erlang: receive...after Ms timeout clause (+9 tests)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-24 21:01:39 +00:00
d191f7cd9e erlang: send + selective receive via shift/reset (+13 tests)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-24 20:27:59 +00:00
266693a2f6 erlang: spawn/1 + self/0 + is_pid (+13 tests)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-24 19:50:09 +00:00
bc1a69925e erlang: scheduler + process record foundation (+39 tests)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-24 19:16:01 +00:00
1dc96c814e erlang: core BIFs + funs, Phase 2 complete (+35 tests)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-24 18:43:25 +00:00
7f4fb9c3ed erlang: guard BIFs + call dispatch (+20 tests)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-24 18:08:48 +00:00
4965be71ca erlang: pattern matching + case (+21 tests)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-24 17:36:44 +00:00
efbab24cb2 erlang: sequential eval (+54 tests)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
2026-04-24 17:03:00 +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
b45a69b7a4 sx: format_number helper — defuse int_of_float overflow on huge floats
Shared formatter in sx_types.ml. Small integer-valued floats still print
as plain ints; floats outside safe-int range (|n| >= 1e16) now print as
%.17g (full precision) instead of silently wrapping to negative or 0.
Non-integer values keep %g 6-digit behavior — no existing SX tests regress.

Unblocks Number.MAX_VALUE / Math.pow(2,N) style tests in js-on-sx where
iterative float loops were collapsing to 0 at ~2^63.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 15:09:11 +00:00
8f202e03c2 js-on-sx: .constructor backlink on Number/String/Array/Object protos (+1)
Number.prototype.constructor === Number etc. Four dict-set! lines add
the backlink after each constructor dict is defined.

new String().constructor === String now returns true. Array literals
don't yet link to Array.prototype so [].constructor === Array is still
false — that would need a boxing refactor.

Unit 521/522, slice 148/148 unchanged.
Number 76/100 → 77/100 (+1). String variance-heavy under CPU load.
2026-04-24 14:18:18 +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
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
9db703324d scoreboard: 162/300 (54.0%) wide, +48 over session baseline 2026-04-24 13:27:55 +00:00
b2810db1a0 js-on-sx: strip leading zeros from exponent in num→string (+3)
SX's (str 1e-7) gives "1e-07" but JS spec is "1e-7" — no padding, no
leading zeros in the exponent (sign stays). We stepped through:
  mant "e" expraw  →  mant "e" (sign (strip-zeros body))

Added four small helpers: js-normalize-num-str, js-split-sign,
js-strip-leading-zeros, js-strip-zeros-loop. All pure string walkers.

Unit 521/522, slice 148/148 unchanged.
String 40 → 42, Number 75 → 76 (+3 total).
Fixes S9.8.1_A9_T1, fromCharCode/S9.7_A3.1_T1..T2 family.
2026-04-24 13:23:08 +00:00
2af31248f2 js-on-sx: js-num-to-int guards NaN/Infinity → 0 (+2 String)
Spec ToUint16 (String.fromCharCode argument coercion) maps non-finite
values to 0. We had bare (floor v) which left inf/-inf/nan through,
breaking:
  String.fromCharCode(Infinity).charCodeAt(0) === 0      // was "" → err
  String.fromCharCode(NaN).charCodeAt(0) === 0           // was "" → err

Add NaN/inf/-inf guards returning 0 before the floor+signed-flip path.

Unit 521/522, slice 148/148 unchanged.
String 38/100 → 40/100 (+2: fromCharCode/S9.7_A1, S9.7_A2.1).
2026-04-24 13:14:23 +00:00
81059861fd js-on-sx: Function.prototype.isPrototypeOf recognises callable recvs (+3)
Tests expected Function.prototype.isPrototypeOf(Number/String/…) ===
true because every built-in ctor inherits from Function.prototype.
Our model doesn't link Number.__proto__ anywhere, so the default
Object.isPrototypeOf walked an empty chain and returned false.

Fix: post-definition dict-set! adds an explicit isPrototypeOf override
on js-function-global.prototype that returns (js-function? x) — which
accepts lambdas, functions, components, and __callable__ dicts. Good
enough to satisfy the spec for every case that isn't a bespoke proto
chain.

Unit 521/522, slice 148/148 unchanged.
Wide scoreboard: 156/300 → 159/300 (+3, Number/S15.7.3_A7 and the
three S15.5.3_A2 / S15.6.3_A2 / S15.9.3_A2 twins).
2026-04-24 13:07:33 +00:00
52fc87f222 scoreboard: 156/300 (52%) wide, +42 from session-start 114/300 2026-04-24 12:54:44 +00:00
2caf356fc4 js-on-sx: Math.X.name / Number.X.name via SX→JS name unmap (+4)
Every built-in JS function on Math/Number/Array/Object had .name === ""
because js-invoke-function-method/js-get-prop returned bare "" for the
"name" slot. That breaks tests like Math.abs.name === "abs" and
Array.isArray.name === "isArray".

Fix: extract the SX symbol name from (inspect fn) which prints
<js-math-abs(x)>, then unmap through a small string table that maps
js-math-abs → "abs", js-array-is-array → "isArray" etc. Also strips
the angle-bracket marker and stops at ( or space.

Non-mapped lambdas (user fns) fall through to the raw "js-foo" form
rather than "", which is slightly worse but only hit in debug prints.

Unit 521/522, slice 148/148 unchanged.
Scoreboard: Math 40/100 → 43/100 (+3); Number 74 → 75 (+1).

Sample: Math/abs/name.js, Math/floor/name.js, Math/max/name.js,
Number/isNaN/name.js — all flipped. length.js tests still fail for
trig because the underlying fn isn't implemented.
2026-04-24 12:49:56 +00:00