c0665ba58e
Adopt Step 7 language features across SX codebase
...
112 conversions across 19 .sx files using match, let-match, and pipe operators:
match (17): type/value dispatch replacing cond/if chains
- lib/vm.sx: HO form dispatch (for-each/map/filter/reduce/some/every?)
- lib/tree-tools.sx: node-display, node-matches?, rename, count, replace, free-symbols
- lib/types.sx: narrow-type, substitute-in-type, infer-type, resolve-type
- web/engine.sx: default-trigger, resolve-target, classify-trigger
- web/deps.sx: scan-refs-walk, scan-io-refs-walk
let-match (89): dict destructuring replacing (get d "key") patterns
- shared/page-functions.sx (20), blog/admin.sx (17), pub-api.sx (13)
- events/ layouts/page/tickets/entries/forms (27 total)
- specs-explorer.sx (7), federation/social.sx (3), lib/ small files (3)
-> pipes (6): replacing triple-chained gets in lib/vm.sx
- frame-closure → closure-code → code-bytecode chains
Also: lib/vm.sx accessor upgrades (get vm "sp" → vm-sp vm throughout)
2650/2650 tests pass, zero regressions.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-04-04 20:49:02 +00:00
2d7dd7d582
Step 5 piece 6: migrate 23 .sx files to define-library/import
...
Wraps all core .sx files in R7RS define-library with explicit export
lists, plus (import ...) at end for backward-compatible global re-export.
Libraries registered:
(sx bytecode) — 83 opcode constants
(sx render) — 15 tag registries + render helpers
(sx signals) — 23 reactive signal primitives
(sx r7rs) — 21 R7RS aliases
(sx compiler) — 42 compiler functions
(sx vm) — 32 VM functions
(sx freeze) — 9 freeze/thaw functions
(sx content) — 6 content store functions
(sx callcc) — 1 call/cc wrapper
(sx highlight) — 13 syntax highlighting functions
(sx stdlib) — 47 stdlib functions
(sx swap) — 13 swap algebra functions
(sx render-trace) — 8 render trace functions
(sx harness) — 21 test harness functions
(sx canonical) — 12 canonical serialization functions
(web adapter-html) — 13 HTML renderer functions
(web adapter-sx) — 13 SX wire format functions
(web engine) — 33 hypermedia engine functions
(web request-handler) — 4 request handling functions
(web page-helpers) — 12 page helper functions
(web router) — 36 routing functions
(web deps) — 19 dependency analysis functions
(web orchestration) — 59 page orchestration functions
Key changes:
- define-library now inherits parent env (env-extend env instead of
env-extend make-env) so library bodies can access platform primitives
- sx_server.ml: added resolve_library_path + load_library_file for
import resolution (maps library specs to file paths)
- cek_run_with_io: handles "import" locally instead of sending to
Python bridge
2608/2608 tests passing.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-04-03 21:48:54 +00:00
14388913c9
Fix 4 pre-existing test failures in deps and orchestration
...
component-pure?: was trusting empty component-io-refs as "definitely pure",
bypassing transitive dependency scan. Now only short-circuits on non-empty
direct IO refs; empty/nil falls through to transitive-io-refs-walk.
render-target: env-get threw on unknown component names. Now guards with
env-has? and returns "server" for missing components.
offline-aware-mutation test: execute-action was a no-op stub that never
called the success callback. Added mock that invokes success-fn so
submit-mutation's on-complete("confirmed") fires.
page-render-plan: was downstream of component-pure? bug, now passes.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-04-02 13:30:03 +00:00
1a3d7b3d77
Separate core spec from web framework
...
Build and Deploy / build-and-deploy (push) Successful in 4m49s
Three-layer architecture:
spec/ — Core language (19 files): evaluator, parser, primitives,
CEK machine, types, continuations. Host-independent.
web/ — Web framework (20 files): signals, adapters, engine,
orchestration, boot, router, CSSX. Built on core spec.
sx/ — Application (sx-docs website). Built on web framework.
Split boundary.sx into boundary-core.sx (type-of, make-env, identical?)
and boundary-web.sx (IO primitives, signals, spreads, page helpers).
Bootstrappers search spec/ → web/ → shared/sx/ref/ for .sx files.
Original files remain in shared/sx/ref/ as fallback during transition.
All 63 tests pass.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-03-15 01:42:19 +00:00