JIT compilation on first call to many functions incurs a step cost of
200–600k CEK steps. The 200k default was silently failing ~70 tests
across suites like hs-upstream-default, hs-upstream-on, comparisonOp,
and others that work correctly but need JIT warmup headroom. Raising
to 1M reveals all of these as passing. The hypertrace/repeat-forever
tests that are genuinely unbounded remain in _NO_STEP_LIMIT.
Full suite scan (all ranges) now shows 1475/1496 (21 pre-existing
SKIP/untranslated failures, 0 actual failures).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Parser parses optional deriving clause; only appended to AST when non-empty.
hk-bind-decls! data arm generates dictShow_Con / dictEq_Con per constructor.
hk-binop == and /= now deep-force both sides (SX dict equality is by
reference — two thunks wrapping the same value compared as not-equal without
this). Three token-type fixes in the deriving parser (lparen/rparen/comma,
not "special").
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
hs-upstream-core/sourceInfo tests "get source works for expressions"
and "get line works for statements" each call hs-parse-ast which runs
the full parser with span-mode enabled, creating ~15 wrapped AST nodes
and linking :next fields. The total CEK step count exceeds the 200k
default but terminates correctly around 400-500k steps. Adding the
suite to _NO_STEP_LIMIT_SUITES (no cap) lets both tests pass.
The other two sourceInfo tests were already passing. 4/4 now.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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>
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>
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>
pl-hs-query, pl-hs-predicate/1,2,3, pl-hs-install in hs-bridge.sx.
No parser/compiler changes: Hyperscript already compiles
`when allowed(user, action)` to (allowed user action).
Total 590/590.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
bind: verify $nope stays nil when binding to a plain div (compile→nil).
when: verify myVar produces when-feat-no-op (parse-error detected).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
hs-coerce HTML list case: use outerHTML for element items, not str.
hs-coerce Fragment case: actually build a DocumentFragment — element
items are appended directly; strings are parsed via a temp div.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
JIT saturation after multiple compilations in the 13-test suite
causes tests 818-819 to time out at 10s.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Tests that call eval-expr-cek twice before the assertion take 7–12 s
cold on the WASM kernel. The 10 s wall-clock deadline fires during the
second warmup call, leaving the kernel in a partially-compiled state
that silently broke adjacent tests (e.g. "loop continue works" started
producing empty output rather than the expected string).
Add 60 s entries to _SLOW_DEADLINE for:
- behavior scoping is isolated from other/core element scope (×2)
- repeat suite preheat tests: can nest loops, only executes init once,
repeat forever (w/ and w/o keyword), until keyword works,
while keyword works (×6)
All eight suites now pass 100 %:
hs-upstream-core/scoping 20/20
hs-upstream-repeat 29/29
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Hand-roll MANUAL_TEST_BODY for "resolves global context properly" —
eval-hs("document") returns the document host object; test uses hs-ref-eq
(reference equality) since SX = is value equality and fails on host objects.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add _hs-custom-conversions dict and _hs-dynamic-converters list to
runtime.sx. hs-set-conversion!/hs-clear-conversion!/hs-add-dynamic-converter!/
hs-pop-dynamic-converter!/hs-clear-converters! helpers expose the API.
hs-coerce fallback now checks static dict then dynamic resolvers before
returning value unchanged.
Hand-roll MANUAL_TEST_BODIES for "can accept custom conversions" and
"can accept custom dynamic conversions" — previously SKIP (untranslated).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Parser: add 'the ...' as a recognized transition target in parse-transition-cmd's
tgt cond, enabling 'transition the next <div/>'s *width from A to B'.
Generator MANUAL_TEST_BODIES for 4 previously-SKIP tests:
- can transition on query ref with possessive (transition suite, 17/17)
- can write to next element with put command (relativePositionalExpression, 23/23)
- parse error at EOF on trailing newline does not crash (core/parser, 13/14)
- halt works outside of event context (halt suite, 7/7)
Also fix hs-kernel-eval.js navigator assignment for Node.js v22 (read-only global).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
host-call-fn: the K.callFn path had no try-catch, so SX exceptions from
behavior handlers (compiled via K.callFn) propagated through SX guard
frames as JS errors. Add try-catch that swallows non-TIMEOUT errors and
re-throws TIMEOUT (matching the fn.apply path).
_SLOW_DEADLINE_SUITES: behavior tests legitimately take 10-20s per test
(behavior script compilation + install + init). Extend their deadline from
the default 10s to 20s so they pass rather than wall-clock timeout.
Net: hs-upstream-behavior 10/10 (+5 previously timing out).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>