559b0df900
GUEST: step 3 — lib/guest/lex.sx character-class + token primitives
...
Extracted shared tokeniser primitives:
- Char-class predicates: lex-digit?, lex-hex-digit?, lex-alpha?
(alias lex-letter?), lex-alnum?, lex-ident-start?, lex-ident-char?,
lex-space? (no newline), lex-whitespace? (incl newline). All nil-safe.
- Token record: lex-make-token, lex-make-token-spanning, accessors.
Ported lib/lua/tokenizer.sx and lib/tcl/tokenizer.sx — 7 lua and 5 tcl
predicate definitions collapsed into prefix-rename calls that alias
lua-/tcl- names to lex- primitives. Test scripts (lua/test.sh,
tcl/test.sh, tcl/conformance.sh) load lib/guest/lex.sx and prefix.sx
before the per-language tokenizer.
Verification:
- lua/test.sh: 185/185 = baseline
- tcl/test.sh: 342/342 (parse 67 + eval 169 + error 39 + namespace 22
+ coro 20 + idiom 25)
- tcl/conformance.sh: 3/4 = baseline (event-loop failure is pre-existing)
Two consumers verified — step complete.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-06 23:06:12 +00:00
2f7f8189ea
GUEST: step 0 — baseline snapshot
...
Created lib/guest/baseline/ with normalised scoreboards for all 11 guests:
lua 185/185, forth 64/64, ruby 76/76, apl 73/73, prolog 590/590,
common-lisp 309/309, smalltalk 625/629, tcl 3/4, haskell 0/18 programs,
js 94/148 (test262-slice), erlang 0/0 (suite all-zero).
Re-ran every conformance.sh and test.sh; refreshed each guest's own
scoreboard.{json,md} so per-guest scoreboard matches lib/guest/baseline/<lang>.json.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-06 22:01:51 +00:00
a32561a07d
merge: architecture → loops/tcl — R7RS, JIT, env-as-value
...
Test, Build, and Deploy / test-build-deploy (push) Failing after 52s
Resolved conflicts in hosts/ocaml/lib/sx_primitives.ml:
- Took architecture's make-regexp/regexp-* primitives (Tcl runtime depends on them)
- Took architecture's Integer typing for clock-seconds/milliseconds/format
- Kept Phase 4 env-lookup/env-extend additions
Tcl: 342/342 tests passing.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-05-06 21:00:51 +00:00
83dbb5958a
tcl: Phase 4 env-as-value — current-env/eval-in-env/env-lookup/env-extend (+5 tests, 342/342 total)
...
Test, Build, and Deploy / test-build-deploy (push) Failing after 53s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-05-06 19:13:28 +00:00
d21cde336a
tcl: Phase 3 OCaml primitives — file-read/write/append/exists?/glob + clock-seconds/milliseconds/format in sx_primitives.ml + unix dep; tcl-cmd-clock/file wired up; 337/337 green
...
Test, Build, and Deploy / test-build-deploy (push) Failing after 50s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-05-06 18:10:22 +00:00
f0f339709e
tcl: replace eager coroutine pre-execution with true suspension via fibers
...
Test, Build, and Deploy / test-build-deploy (push) Failing after 45s
Rewrote the coroutine implementation to use lib/fiber.sx (make-fiber,
fiber-resume, fiber-done?) instead of eagerly running the proc body and
collecting all yields into a list. Each coroutine is now a live fiber —
calls to the coro command invoke fiber-resume, yield suspends via call/cc.
- make-tcl-interp: remove :coroutines/:in-coro/:coro-yields, add :coro-yield-fn nil
- tcl-cmd-yield: calls :coro-yield-fn (fiber's yield fn) to truly suspend
- tcl-cmd-yieldto: same pattern, yields "" to resumer
- make-coro-cmd: takes fiber (not coro-name), calls fiber-resume on each invoke
- tcl-cmd-coroutine: creates a fiber whose body runs the proc with :coro-yield-fn set
- tcl-call-proc result merge: drop :coro-yields/:coroutines propagation
- test.sh: load lib/fiber.sx before lib/tcl/runtime.sx in epoch 4
All 337/337 tests pass including all 20 coro tests.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-05-06 17:30:47 +00:00
35511db15b
tcl: array get/set/names/size/exists/unset commands (+8 tests, 337 total)
...
Test, Build, and Deploy / test-build-deploy (push) Failing after 45s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-05-06 16:29:28 +00:00
40ce4df6b1
tcl: apply command — anonymous proc call reusing tcl-call-proc frame machinery
Test, Build, and Deploy / test-build-deploy (push) Failing after 44s
2026-05-06 15:37:26 +00:00
0cc36450c4
tcl: regexp + regsub commands wrapping SX regex primitives
...
Test, Build, and Deploy / test-build-deploy (push) Failing after 43s
regexp: -nocase/-all/-inline flags, optional matchVar + subgroup var args.
regsub: -all/-nocase flags, optional varName (stores result + returns count)
or inline use (returns result string). Both wrap make-regexp/regexp-match/
regexp-match-all/regexp-replace/regexp-replace-all. 329/329 tests green.
2026-05-06 15:31:36 +00:00
21e8e51174
tcl: float expr — tcl-parse-num + float-aware binop/unary/pow/funcs
...
Test, Build, and Deploy / test-build-deploy (push) Failing after 16s
parse-int "2.0" returns nil in SX (strict integer parse); fixed by adding
tcl-num-float? (char scan for ./e/E) and tcl-parse-num (routes to
parse-float when float-shaped). Applied in tcl-apply-binop (all arith +
comparisons), tcl-apply-func (parse-float for all math args), unary minus,
and tcl-expr-parse-power (**). Real sqrt/floor/ceil/round/pow/sin/cos/tan/
exp/log now used instead of integer stubs. Integer division still truncates
when both operands are integer-shaped. 329/329 tests green.
2026-05-06 15:20:10 +00:00
bf190b8fc4
tcl: merge loops/tcl — complete Tcl 8.6 subset (329 tests)
...
Test, Build, and Deploy / test-build-deploy (push) Failing after 52s
Phases 1-6: Dodekalogue tokenizer/parser, eval engine, expr mini-language,
string/list/dict commands, proc + uplevel/upvar (the headline showcase),
catch/try/throw, namespaces + ensembles, generator coroutines, idiom corpus.
Resolved add/add conflicts by taking loops/tcl (the complete tested impl)
over the architecture branch's earlier prototype.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-05-06 11:36:59 +00:00
2c61be39de
tcl: Phase 6 coroutines + clock/file stubs + idiom corpus (+40 tests, 329 total)
...
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
- Coroutines (generator-style): coroutine/yield/yieldto commands; eager yield
collection during body execution, pop-on-call dispatch via registered command
closures; coro-yields + coroutines threaded through tcl-call-proc
- info exists varname (plus hostname/script/tclversion stubs)
- clock seconds/milliseconds/format/scan stubs
- File I/O stubs: open/close/read/eof/seek/tell/flush + file subcommands
- format command: full %-specifier parsing with flags, width, zero-pad, left-align
- Fixed dict set/unset/incr/append/update to use tcl-var-get (upvar alias aware)
- Fixed lappend and append to use tcl-var-get for reading (upvar alias aware)
- 20 coroutine tests (coro.sx) + 20 idiom corpus tests (idioms.sx)
- event-loop.tcl program: cooperative scheduler demo using coroutines
- Note: coroutines eagerly collect yields (generator-style, not true suspension)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-05-06 11:05:28 +00:00
23c44cf6cf
tcl: Phase 5 namespaces + ensembles (+22 tests, 289 total)
...
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
Implements namespace eval, current, which, exists, delete, export,
import, forget, path, and ensemble create (auto-map + -map). Procs
defined inside namespace eval are stored as fully-qualified names
(::ns::proc), resolved relative to the calling namespace at lookup
time. Proc bodies execute in their defining namespace so sibling
calls work without qualification.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-05-06 10:21:21 +00:00
d295ab8463
tcl: Phase 4 error handling — catch/try/throw/return-code (+39 tests, 267 total)
...
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
Implements catch, throw, try, return -code options, and error with
errorinfo/errorcode fields. catch runs sub-script isolated, captures
result and exit code (0-4); try dispatches on/finally clauses;
throw sets code 1 with errorcode; return -code parses flag options.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-05-06 09:58:32 +00:00
95f96efb78
tcl: conformance.sh + scoreboard, annotate classic programs
...
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
Adds lib/tcl/conformance.sh: runs .tcl programs through the epoch
protocol, compares against # expected: annotations, writes
scoreboard.json and scoreboard.md. All 3 classic programs pass.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-05-06 09:44:44 +00:00
95b22a648d
tcl: classic programs — for-each-line, assert, with-temp-var (+3 tests, 228 total)
...
Test, Build, and Deploy / test-build-deploy (push) Failing after 42s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-05-06 09:34:26 +00:00
eb5babaf99
tcl: proc + uplevel + upvar + global + variable + info (+19 tests, 225 total)
...
Test, Build, and Deploy / test-build-deploy (push) Failing after 48s
Phase 3 headline feature: everything falls out of SX's first-class env chain.
- make-tcl-interp extended with :frame-stack and :procs fields
- proc: user-defined commands with param binding, rest args, isolated scope
- uplevel: run script in ancestor frame with correct frame propagation
- upvar: alias local name to remote frame variable (get/set follow alias)
- global/variable: sugar for upvar #0
- info: level, vars, locals, globals, commands, procs, args, body
- tcl-call-proc propagates updated frames back to caller after proc returns
- test.sh timeout bumped to 90s for larger runtime
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-05-06 09:30:28 +00:00
263d9aae68
tcl: dict commands — 13 subcommands (+24 tests, 206 total)
...
Test, Build, and Deploy / test-build-deploy (push) Failing after 13s
Implements tcl-cmd-dict with create/get/set/unset/exists/keys/values/
size/for/update/merge/incr/append subcommands, plus helpers
tcl-dict-to-pairs, tcl-dict-from-pairs, tcl-dict-get, tcl-dict-set-pair,
tcl-dict-unset-key. Registers "dict" in make-default-tcl-interp.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-05-06 09:00:13 +00:00
7b11f3d44a
tcl: list commands — 12 commands (+26 tests, 182 total)
...
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-05-06 08:54:24 +00:00
9ed3e4faaf
tcl: string command — 16 subcommands + 29 tests (156 total)
...
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
Implements tcl-cmd-string covering length, index, range, compare, match
(glob * and ?), toupper, tolower, trim/trimleft/trimright, map, repeat,
first, last, is (integer/double/alpha/alnum/digit/space/upper/lower/boolean),
and cat. All 156 tcl tests pass (parse: 67, eval: 89).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-05-06 08:48:43 +00:00
ac013c9381
tcl: expr mini-language — recursive descent parser (+20 tests, 127 total)
...
Test, Build, and Deploy / test-build-deploy (push) Failing after 42s
Replaces 3-token flat evaluator with full recursive descent parser:
operator precedence, parentheses, unary ops, ** power, function calls
(abs/sqrt/pow/max/min/int/double), expression tokenizer for dense syntax.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-05-06 08:43:02 +00:00
3e07727d6b
phase 22 tcl: string-buffer/channel/regexp/format/coroutine in lib/tcl/runtime.sx (37 forms), 56/56 tests
2026-05-01 23:24:56 +00:00
c8d7fdd59a
tcl: Phase 2 core commands — if/while/for/foreach/switch/break/continue/return/error/expr (+20 tests, 107 total)
...
Test, Build, and Deploy / test-build-deploy (push) Failing after 16s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-04-26 14:40:48 +00:00
82da16e4bb
tcl: Phase 2 eval engine — tcl-eval-script + set/puts/incr/append (+20 tests, 87 total)
...
Test, Build, and Deploy / test-build-deploy (push) Failing after 17s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-04-26 14:02:52 +00:00
6ee052593c
tcl: Phase 1 parser — word-simple? + word-literal helpers (+15 tests, 67 total)
2026-04-25 18:47:34 +00:00
666e29d5f0
tcl: Phase 1 tokenizer — Dodekalogue (52 tests green)
2026-04-25 18:22:10 +00:00