Commit Graph

1936 Commits

Author SHA1 Message Date
3c0a963229 erlang-runtime: add lib/erlang/runtime.sx + test.sh (55/55 pass)
Numeric tower (is-integer?/float?/number?, float/trunc/round/abs/max/min),
div/rem (quotient/remainder), bitwise (band/bor/bxor/bnot/bsl/bsr),
sets module (new/add/member/union/intersection/subtract/size/to-list/from-list),
re module (run/replace/replace-all/match-groups/split),
list BIFs (hd/tl/length/member/reverse/nth/foldl/foldr/seq/flatten/zip),
type conversions (integer-to-list, list-to-integer, atom-to-list, etc.),
ok/error tuple helpers.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 21:21:39 +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
ec3512d63b lua-runtime: add math/string/table stdlib + delay/force (185/185 pass)
math: abs/ceil/floor/sqrt/sin/cos/tan/asin/acos/atan/exp/log/max/min/pi/huge
string: len/sub/upper/lower/rep/reverse/byte/char/find/match/gmatch/gsub
table: insert/remove/concat/sort
lua-force: force promises (delay thunk protocol)
Fix lua-len: replace has? (unavailable in sx_server) with nil-check.
Fix string.byte: use string->list to get char type, not nth on string.
Fix string.char: truncate float codes before integer->char.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 21:14:14 +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
1ad8e74aa6 cl-runtime: add lib/common-lisp/runtime.sx + test.sh (68/68 pass)
Type predicates, arithmetic, chars (inline α/digit/case),
format, gensym, values, sets, radix, list utilities.
cl-empty? guards all list traversal against () vs nil in sx_server.
Load spec/stdlib.sx in test.sh to expose format.
Fix lib/r7rs.sx number->string to use (= (len r) 0) not (nil? r).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 21:00:22 +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
4d7b3e299c spec: format — CL-style string formatting (~a ~s ~d ~x ~o ~b ~f ~% ~& ~~ ~t)
28 tests, passes on both JS and OCaml.
- spec/stdlib.sx: pure SX format function
- spec/primitives.sx: format primitive declaration
- lib/r7rs.sx: fix number->string to support optional radix arg
- hosts/ocaml: add format-decimal primitive, load stdlib.sx in test runner
- hosts/javascript: load stdlib.sx in test runner

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 19:58:54 +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
a381154507 spec: bytevectors (make-bytevector/u8-ref/u8-set!/utf8->string/etc)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 19:16:02 +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
d8d5588e42 spec: regular expressions (make-regexp/regexp-match/regexp-replace + split)
Adds 9 regexp primitives to stdlib.regexp. OCaml: SxRegexp(src,flags,Re.re)
using Re.Pcre; $&/$1 capture expansion in replace. JS: native RegExp
with SxRegexp wrapper; regexp-match returns {:match :start :end :groups}.
32 tests in test-regexp.sx, all pass on both hosts.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 18:57:54 +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
3b0ac67a10 spec: sets (make-set/set-add!/set-member?/union/intersection/etc)
Adds 13 set primitives to stdlib.sets. OCaml: SxSet as (string,value)
Hashtbl keyed by inspect(val); JS: SxSet wrapping Map keyed by
write-to-string. Structural equality — (make-set '(1 2)) contains 1.
Includes union, intersection, difference, for-each, map.
33 tests in test-sets.sx, all pass on both JS and OCaml.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 18:45:46 +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
7d329f024d spec: read/write/display — S-expression reader/writer on ports
Adds read, write, display, newline, write-to-string, display-to-string
and current-*-port primitives to both JS and OCaml hosts.

JS: sxReadNormalize (#t/#f→true/false), sxReadConvert (()→nil),
    sxEq array comparison, sxWriteVal symbol/keyword name fix,
    readerMacroGet/readerMacroSet registry in parser platform.
OCaml: sx_write_val/sx_display_val helpers, read/write/display/newline
    primitives on port types; parser extended for #t/#f and N/D rationals.
42 new tests (test-read-write.sx), all passing on JS and OCaml.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 18:32:30 +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
036022cc17 spec: rational numbers — 1/3 literals, arithmetic, numeric tower integration
SxRational type in OCaml (Rational of int * int, stored reduced, denom>0)
and JS (SxRational class with _rational marker). n/d reader syntax in
spec/parser.sx. Arithmetic contagion: int op rational → rational, rational
op float → float. JS keeps int/int → float for CSS backward compatibility.
OCaml as_number + safe_eq extended for cross-type rational equality so
(= 2.5 5/2) → true. 62 tests in test-rationals.sx, all pass.
JS: 2232 passed. OCaml: 4532 passed (+11 vs pre-fix baseline).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 17:27:27 +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
be2b11acc2 spec: math completeness — trig, quotient, gcd/lcm, radix number<->string
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
Phase 15 implementation:
- spec/primitives.sx: stdlib.math module — sin/cos/tan/asin/acos/atan/exp/log/expt/quotient/gcd/lcm/number->string/string->number (13 primitives)
- JS platform: stdlib.math module; strict string->number parsing (rejects partial matches like "fg" in base 16)
- OCaml: expt, quotient, gcd, lcm, number->string (radix), string->number (radix); atan updated to accept optional 2nd arg (atan2 form)
- spec/tests/test-math.sx: 44 tests — trig/inverse trig, expt, quotient semantics, gcd/lcm, radix formatting/parsing, tower integration
- JS: 2311/4801 (+2 net); OCaml: 4547/5629 (+1 net); zero regressions in math area

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 16:23:40 +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
8ba0a33f6e ocaml: string ports (Eof + Port variants, 15 primitives)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
Eof sentinel and Port{PortInput/PortOutput} in sx_types.ml. All 15 port
primitives in sx_primitives.ml. type_of/inspect updated. 39/39 port tests
pass (4532 total, +39, zero regressions).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 12:50:20 +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
3d8937d759 spec: string ports (open-input-string/open-output-string/read-char/etc)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
Phase 14: port type + eof-object. Input ports track _pos cursor; output ports
accumulate _buffer. All 15 port primitives in spec/primitives.sx (stdlib.ports
module), platform.py (JS), and 39/39 tests in spec/tests/test-ports.sx.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 12:38:08 +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
b939becd86 ocaml: character type — Char of int, #\a parser, all char primitives
- Char of int variant in sx_types.ml (Unicode codepoint)
- type_of → "char", inspect → #\a / #\space / #\newline notation
- #\ char literal reader in sx_parser.ml (named + single-char)
- make-char char? char->integer integer->char char-upcase char-downcase
- char=? char<? char>? char<=? char>=? comparators
- char-ci=? char-ci<? char-ci>? char-ci<=? char-ci>=? case-insensitive
- char-alphabetic? char-numeric? char-whitespace? char-upper-case? char-lower-case?
- string->list (returns Char values) and list->string (accepts Char values)
- fix get_val in sx_runtime.ml: add Integer n case for list indexing
- fix raw_serialize in sx_server.ml: Integer and Char variants
- 4493/4493 tests — +43 passing, zero regressions

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 12:19:42 +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
4b600f17e8 spec: character type (char? char->integer #\a literals + predicates)
- Add SxChar tagged object {_char, codepoint} to JS platform
- char? char->integer integer->char char-upcase char-downcase
- char=? char<? char>? char<=? char>=? comparators
- char-ci=? char-ci<? char-ci>? char-ci<=? char-ci>=? case-insensitive
- char-alphabetic? char-numeric? char-whitespace? char-upper-case? char-lower-case?
- string->list (returns chars) and list->string (accepts chars)
- #\a #\space #\newline reader syntax in spec/parser.sx
- integer->char alias in spec/evaluator.sx
- js-char-renames dict in transpiler.sx for ->-containing names
- 43 tests in spec/tests/test-chars.sx, all passing

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 11:50:04 +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
edf4e525f8 spec: gensym + symbol interning — *gensym-counter*, string->symbol, symbol->string, intern
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 10:28:18 +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
0fe00bf7ac spec: sequence protocol tests — 45 tests, all passing on JS and OCaml
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 10:18:37 +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
7286629cf7 ocaml: sequence protocol — seq_to_list coercion in HO dispatch + sequence-* primitives
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 10:01:22 +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
133bdf5295 spec: mutable hash tables (make-hash-table/ref/set!/delete!/etc)
Phase 10 — 11 primitives: make-hash-table, hash-table?, hash-table-set!,
hash-table-ref, hash-table-delete!, hash-table-size, hash-table-keys,
hash-table-values, hash-table->alist, hash-table-for-each, hash-table-merge!.
OCaml HashTable variant; JS Map-based. 28 tests, both hosts green.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 08:48:41 +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
e44cb89ab4 spec: promises — delay/force/delay-force/make-promise/promise?
25 tests pass on OCaml (4357 total) and JS. Promise represented as
mutable dict {:_promise true :forced :thunk :value}; delay-force
adds :_iterative for chain-following semantics.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 08:21:45 +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
43cc1d9003 spec: multiple values — values/call-with-values/let-values/define-values
25 tests pass on both JS and OCaml hosts. Uses dict marker
{:_values true :_list [...]} for 0/2+ values; 1 value passes
through directly. step-sf-define extended to desugar shorthand
(define (name params) body) forms on both hosts.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 08:03:17 +00:00
8328e96ff6 primitives-loop: push to origin/architecture after each commit
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 13s
2026-04-26 19:33:27 +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
a8a79dc902 spec: bitwise operations (bitwise-and/or/xor/not, arithmetic-shift, bit-count, integer-length)
OCaml: land/lor/lxor/lnot/lsl/asr in sx_primitives.ml
JS: & | ^ ~ << >> with Kernighan popcount and Math.clz32 for integer-length
spec/primitives.sx: stdlib.bitwise module with 7 entries
26 tests, 158 assertions, all pass OCaml+JS

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-26 19:06:09 +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