Commit Graph

231 Commits

Author SHA1 Message Date
71c4b5e33f cl: Phase 3 all complete — conformance.sh runner, 363/363 tests green
conformance.sh runs all 7 test suites (reader/parser/eval/conditions/
restart-demo/parse-recover/interactive-debugger), writes scoreboard.json
and scoreboard.md. 363 total tests: 79 tokenizer, 31 parser/lambda-lists,
174 evaluator (including unwind-protect), 59 conditions, 20 classic programs.
Phase 3 fully complete — all roadmap boxes ticked.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-05 11:24:50 +00:00
4cd8773766 cl: multiple values — 15 new tests (174 eval, 346 total green)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 46s
VALUES wraps 2+ values in {:cl-type "mv"}; cl-mv-primary strips to
primary in IF/AND/OR/COND/cl-call-fn single-value contexts; cl-mv-vals
expands for MULTIPLE-VALUE-BIND, MULTIPLE-VALUE-CALL, NTH-VALUE.
2026-05-05 11:23:12 +00:00
733b1ebefa cl: Phase 3 complete — *debugger-hook*, *break-on-signals*, invoke-restart-interactively (147 tests)
cl-debugger-hook: mutable global (fn (c hook) result); cl-invoke-debugger
calls it with infinite-recursion guard (sets hook nil during call).
cl-error now routes unhandled errors through cl-invoke-debugger instead of
bare host error — allows the hook to invoke a restart and resume.
cl-break-on-signals: when set to a type name, cl-signal fires the debugger
hook before walking handlers if the condition matches.
cl-invoke-restart-interactively: calls the restart fn with no args (no
terminal protocol — equivalent to (invoke-restart name)).
4 new tests in conditions.sx covering all three; Phase 3 fully complete.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-05 11:21:52 +00:00
85911d7b84 cl: Phase 3 interactive-debugger — *debugger-hook* pattern, 7 tests (143 total)
cl-debugger-hook global (nil = default), cl-invoke-debugger walks the hook,
cl-error-with-debugger routes unhandled errors through the hook, and
make-policy-debugger builds a hook from a (fn (condition restarts) name)
policy function. Tests: hook receives condition, policy selects use-zero/abort
restarts, compute-restarts visible inside hook, handler wins before hook fires,
infinite-recursion guard. Wired into test.sh program suite runner.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-05 11:17:57 +00:00
ab66b29a74 cl: Phase 3 classic programs — restart-demo (7 tests) + parse-recover (6 tests)
restart-demo.sx: safe-divide with division-by-zero condition, use-zero
and retry restarts. Demonstrates handler-bind invoking a restart to
resume computation with a corrected value.

parse-recover.sx: token parser signalling parse-error on non-integer
tokens, skip-token and use-zero restarts. Demonstrates recovery-via-
restart and handler-case abort patterns.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-05 11:16:35 +00:00
32a82a2e12 cl: unwind-protect — 8 new tests (159 eval, 331 total green)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 44s
cl-eval-unwind-protect evaluates protected form, runs cleanup via
for-each (results discarded, sentinels preserved), returns original
result — correctly propagates block-return/go-tag through cleanup.
2026-05-05 11:14:39 +00:00
7d6df6fd5f cl: Phase 3 conditions + restarts — handler-bind, handler-case, restart-case, 55 tests (123 total runtime)
define-condition with 15-type ANSI hierarchy (condition/error/warning/
simple-error/simple-warning/type-error/arithmetic-error/division-by-zero/
cell-error/unbound-variable/undefined-function/program-error/storage-condition).

cl-condition-of-type? walks the hierarchy; cl-make-condition builds tagged
dicts {:cl-type "cl-condition" :class name :slots {...}}. cl-signal-obj
walks cl-handler-stack for non-unwinding dispatch. cl-handler-case and
cl-restart-case use call/cc escape continuations for unwinding. All stacks
are mutable SX globals (the built-in handler-bind/restart-case only accept
literal AST specs — not computed lists). Key fix: cl-condition-of-type?
captures cl-condition-classes at define-time via let-closure to avoid
free-variable failure through env_merge parent chain.

55 tests in lib/common-lisp/tests/conditions.sx, wired into test.sh.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-05 11:14:04 +00:00
a12a6a11cb cl: tagbody + go — 11 new tests (151 eval, 323 total green)
Sentinel-based tagbody: cl-build-tag-map indexes tags by str-normalised key
(handles integer tags); cl-eval-tagbody loops with go-jump restart;
go-tag propagates through cl-eval-body alongside block-return.
2026-05-05 11:07:43 +00:00
ce7243a1fb cl: block + return-from — 13 new tests (140 eval, 312 total green)
Sentinel propagation in cl-eval-body; cl-eval-block catches matching
sentinels; BLOCK/RETURN-FROM/RETURN dispatch added to cl-eval-list.
Parser: CL strings now {:cl-type "string"} dicts for proper CL semantics.
2026-05-05 10:57:33 +00:00
3f8fe41d4d Merge architecture into loops/common-lisp 2026-05-05 10:47:02 +00:00
086ad028ce Merge loops/erlang into architecture — 530/530 tests, all phases complete 2026-05-05 10:42:07 +00:00
97ccd61f74 Merge loops/smalltalk into architecture — 847/847 tests, all phases complete 2026-05-05 10:41:58 +00:00
90bc1208d9 plan: tick Phase 22 Forth — all Phase 22 items complete
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 34s
2026-05-01 23:31:08 +00:00
2edd426748 plan: tick Phase 22 Tcl — complete, Forth next
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 21s
2026-05-01 23:25:14 +00:00
bcde5e126a plan: tick Phase 22 Ruby — complete, Tcl next
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 37s
2026-05-01 23:18:28 +00:00
912de5a274 phase-22 APL: runtime.sx vectors/bitwise/sets/reduce/format
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 34s
lib/apl/runtime.sx (60 forms):
- Core: apl-iota (1..N), apl-rho (shape), apl-at (1-indexed access).
- Rank-polymorphic apl-dyadic/apl-monadic helpers: scalar×scalar,
  scalar×vector, vector×vector all supported uniformly.
- Arithmetic: add/sub/mul/div/mod/pow/max/min, neg/abs/floor/ceil/sqrt.
- Comparison: eq/neq/lt/le/gt/ge → 0/1 result vectors.
- Boolean: and/or/not on 0/1 values, element-wise.
- Bitwise: bitand/bitor/bitxor/bitnot/lshift/rshift — element-wise.
- Reduction: reduce-add/mul/max/min/and/or; scan-add/mul.
- Vector ops: reverse, cat (scalar/vector catenate), take (±N), drop (±N),
  rotate, compress (boolean mask), index (multi-index).
- Set ops: member (∊, → 0/1), nub (∪, unique preserve-order),
  union, intersect (∩), without (~). All use SX make-set internally.
- Format (⍕): vector → space-separated string, scalar → str.

lib/apl/tests/runtime.sx + lib/apl/test.sh: 73/73 pass.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 22:49:38 +00:00
077f4a5d38 phase-22 Smalltalk: runtime.sx numeric/char/Array/Dict/Set/Stream
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 36s
lib/smalltalk/runtime.sx (72 forms):
- Numeric helpers: abs/max/min/gcd/lcm/quo/rem/mod/even?/odd?/floor/ceil/truncate/round.
- Character: st-char-value/from-int/is-letter?/is-digit?/uppercase?/lowercase?/
  separator?/as-uppercase/as-lowercase/digit-value. SX chars via char->integer.
- Array: 1-indexed mutable arrays backed by dict {__st_array__ size "1" v1 ...};
  at/at-put!/do/->list/list->array/copy-from-to.
- Dictionary: any-key hash map via list-of-pairs + linear scan;
  at/at-put!/includes-key?/at-default/remove-key!/keys/values/do/do-associations.
- Set: backed by SX make-set; set-member?/add!/includes?/remove! take (set item) order.
- WriteStream/ReadStream: dict-backed buffers; printString for nil/bool/number/
  string/symbol/char/list/array.

lib/smalltalk/tests/runtime.sx + lib/smalltalk/test.sh: 86/86 pass.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 22:43:04 +00:00
36e6762539 phase-22 JS: stdlib.sx bitwise/Map/Set/RegExp + 25 tests
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 38s
lib/js/stdlib.sx (36 forms):
- Bitwise ops (js-bitand/bitor/bitxor/lshift/rshift/urshift/bitnot) use
  truncate instead of js-num-to-int (which calls integer /0 and crashes).
- Map class: dict-backed list-of-pairs with linear-scan find, mutable via
  dict-set!; js-map-new/get/set!/has/delete!/clear/keys/vals/entries/for-each.
- Set class: backed by SX make-set primitive; set-member?/set-add!/set-remove!
  all take (set item) argument order — fixed from (item set) which threw.
- RegExp: callable lambda wrapping js-regex-new (not a dict, so directly callable).
- Wires Map/Set/RegExp into js-global.

lib/js/test.sh: epochs 6000-6032 (25 tests) — all pass.
Result: 492/585 tests pass (was 466/560 before this phase).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 22:33:27 +00:00
4022b60901 plan: tick Phase 22 Haskell — runtime.sx done, 148/148 tests
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 32s
2026-05-01 21:41:38 +00:00
a7790418f8 plan: tick Phase 22 Erlang — runtime.sx complete, 55/55 pass
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 37s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 21:21:57 +00:00
a8613656e9 plan: tick Phase 22 Lua — stdlib complete, 185/185 pass
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 39s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 21:14:47 +00:00
10c278d073 plan: tick Phase 22 CL — runtime.sx complete, 68/68 pass
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 40s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 21:00:42 +00:00
f4193a2e8e plan: tick Phase 22 step 1 — baseline sections added
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 34s
2026-05-01 20:21:07 +00:00
f43659ce51 plan: add SX primitive baseline section to CL/APL/Ruby/Tcl plans 2026-05-01 20:20:56 +00:00
d4964c166c plan: tick Phase 21 format — complete, Phase 22 next
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 37s
2026-05-01 19:59:23 +00:00
6a34ae3ae1 plan: tick Phase 20 bytevectors — complete, Phase 21 next
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 37s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 19:16:28 +00:00
24e1a862fb plan: tick Phase 19 regexp — complete, Phase 20 next
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 37s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 18:58:11 +00:00
a40a970080 plan: tick Phase 18 sets — complete, Phase 19 next
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 40s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 18:46:01 +00:00
24d78464d8 plan: tick Phase 17 read/write/display — complete, Phase 18 next
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 36s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 18:33:02 +00:00
c8582c4d49 plan: tick Phase 16 rational numbers — complete, Phase 17 next
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 37s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 17:27:43 +00:00
e9d2003d6a plan: tick Phase 15 complete — math completeness done, Phase 16 next
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 34s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 16:24:05 +00:00
ab3c3693c0 plan: tick Phase 14 OCaml — Phase 14 complete, Phase 15 next
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 40s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 12:50:38 +00:00
e9abc2cf61 plan: tick Phase 14 Spec+JS+Tests+Commit — OCaml step next
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 34s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 12:38:31 +00:00
dfbcece644 plan: tick Phase 13 OCaml — Phase 13 complete, Phase 14 next
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 33s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 12:19:54 +00:00
60f88ab4fe plan: tick Phase 13 Spec+JS+Tests+Commit — OCaml step next
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 37s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 11:50:55 +00:00
46da676c29 plan: tick Phase 12 complete — gensym + symbol interning done
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 33s
2026-05-01 10:57:13 +00:00
0862a6140b spec: gensym + symbol interning (OCaml + tests)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 32s
gensym_counter ref + gensym/string->symbol/symbol->string/intern/symbol-interned?
primitives in sx_primitives.ml. Fix ListRef case in seq_to_list on both
sx_ref.ml and sx_primitives.ml. 19 new tests in test-gensym.sx.
OCaml 4450/1080, JS 2205/2497, zero regressions.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 10:56:30 +00:00
130d4d7c18 plan: tick Phase 11 Commit — sequence protocol fully landed
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 20s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 10:22:36 +00:00
ac79328418 plan: tick Phase 11 Tests — 45 sequence tests all passing
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 23s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 10:19:10 +00:00
06a3eee114 plan: tick Phase 11 JS bootstrapper — already done in Spec step
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 17s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 10:05:47 +00:00
c3d2b9d87d plan: tick Phase 11 OCaml — HO dispatch + sequence-* primitives done
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 17s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 10:01:49 +00:00
da4b526abb spec: sequence protocol Spec step — seq-to-list + ho polymorphic dispatch
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 15s
- seq-to-list: coerce list/vector/string/nil to list
- ho-setup-dispatch: apply seq-to-list to all collection args so map/filter/
  reduce/for-each/some/every? work over vectors and strings natively
- sequence->list, sequence->vector, sequence-length, sequence-ref,
  sequence-append: full polymorphic sequence helpers
- in-range: list-returning range generator (eager, works with all HO forms)
- Restore 3 accidentally-deleted make-cek-state/make-cek-value/make-cek-suspended
- Fix 8 shorthand define forms (transpiler requires long form)
- Add vector->list/list->vector to transpiler js-renames + platform aliases
- JS: 2137 passing (+28 vs HEAD baseline)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 09:31:28 +00:00
59a835efc3 plan: tick Phase 10 hash tables — complete, Phase 11 next
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 13s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 08:49:14 +00:00
2e4502878f plan: tick Phase 9 complete — promises done
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 19s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 08:22:10 +00:00
835b5314ce plan: tick Phase 8 complete — multiple values done
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 24s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 08:04:08 +00:00
24522902cc plan: tick Phase 7 bitwise — complete, Phase 8 next
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 16s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-26 19:06:30 +00:00
1ad9d63f1b plan: tick Phase 6 JS+Tests+Commit — ADT complete, Phase 7 next
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-26 18:56:22 +00:00
f63b214726 plan: tick Phase 6 OCaml task — ADT bootstrap implementation done
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-26 18:52:40 +00:00
0dc7e1599c spec: match special form — ADT constructor pattern matching (20 tests)
Extends match-pattern in spec/evaluator.sx with an ADT case: when the
pattern is (CtorName var...) and the value is an ADT dict (:_adt true),
check :_ctor matches, arity matches, then recursively bind field patterns.
Supports nested patterns, wildcard _, variable binding, and zero-arg ctors.

Changes step-sf-match to route no-clause errors through raise-eval-frame
instead of direct error, allowing guard to catch non-exhaustive matches.

40/40 ADT tests pass (20 define-type + 20 match). Zero regressions.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-26 18:16:16 +00:00
6c87210728 spec: define-type special form — constructors, predicates, accessors (20 tests)
Adds sf-define-type via register-special-form! in spec/evaluator.sx.
ADT values are dicts {:_adt true :_type "T" :_ctor "C" :_fields (list ...)}.
Each define-type call registers: ctor functions with arity checking, Name?
type predicate, Ctor? constructor predicates, Ctor-field positional accessors,
and populates *adt-registry* dict with type→[ctor-names] mapping.
20/20 JS tests pass in spec/tests/test-adt.sx.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-26 17:56:50 +00:00