WIP: pre-existing changes from WASM browser work + test infrastructure
Accumulated changes from WASM browser development sessions: - sx_runtime.ml: signal subscription + notify, env unwrap tolerance - sx_browser.bc.js: rebuilt js_of_ocaml browser kernel - sx_browser.bc.wasm.js + assets: WASM browser kernel build - sx-platform.js browser tests (test_js, test_platform, test_wasm) - Playwright sx-inspect.js: interactive page inspector tool - harness-web.sx: DOM assertion updates - deploy.sh, Dockerfile, dune-project: build config updates - test-stepper.sx: stepper unit tests - reader-macro-demo plan update Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -43,6 +43,11 @@ RUN cp -r sx-app-tmp/app.py sx-app-tmp/path_setup.py \
|
||||
([ -d sx-app-tmp/sx ] && cp -r sx-app-tmp/sx ./sx || true) && \
|
||||
rm -rf sx-app-tmp
|
||||
|
||||
# SX spec, library, and web adapter files (loaded by OCaml kernel)
|
||||
COPY spec/ ./spec/
|
||||
COPY lib/ ./lib/
|
||||
COPY web/ ./web/
|
||||
|
||||
# Sibling models for cross-domain SQLAlchemy imports
|
||||
COPY blog/__init__.py ./blog/__init__.py
|
||||
COPY blog/models/ ./blog/models/
|
||||
|
||||
@@ -6,10 +6,10 @@
|
||||
(div :class "grid grid-cols-1 md:grid-cols-2 gap-4"
|
||||
(div
|
||||
(p :class "text-xs text-stone-500 uppercase tracking-wider mb-1" "SX Source")
|
||||
(~docs/code :code (highlight sx-source "lisp")))
|
||||
(~docs/code :src (highlight sx-source "lisp")))
|
||||
(div
|
||||
(p :class "text-xs text-stone-500 uppercase tracking-wider mb-1" "SMT-LIB Output (live from z3.sx)")
|
||||
(~docs/code :code (highlight smt-output "lisp")))))
|
||||
(~docs/code :src (highlight smt-output "lisp")))))
|
||||
|
||||
(defcomp ~plans/reader-macro-demo/plan-reader-macro-demo-content ()
|
||||
(~docs/page :title "Reader Macro Demo: #z3"
|
||||
@@ -75,12 +75,12 @@
|
||||
"Below is the live SMT-LIB output from translating the full " (code "primitives.sx") " — all 87 primitive declarations. The composition is pure SX: " (code "(z3-translate-file (sx-parse (read-spec-file \"primitives.sx\")))") " — read the file, parse it, translate it. No Python glue.")
|
||||
|
||||
(~docs/subsection :title "primitives.sx (87 primitives)"
|
||||
(~docs/code :code (highlight (z3-translate-file (sx-parse (read-spec-file "primitives.sx"))) "lisp"))))
|
||||
(~docs/code :src (highlight (z3-translate-file (sx-parse (read-spec-file "primitives.sx"))) "lisp"))))
|
||||
|
||||
(~docs/section :title "The translator: z3.sx" :id "z3-source"
|
||||
(p :class "text-stone-600"
|
||||
"The entire translator is a single SX file — s-expressions that walk other s-expressions and emit strings. No host language logic. The same file runs in Python (server) and could run in JavaScript (browser) via the bootstrapped evaluator.")
|
||||
(~docs/code :code (highlight (read-spec-file "z3.sx") "lisp"))
|
||||
(~docs/code :src (highlight (read-spec-file "z3.sx") "lisp"))
|
||||
(p :class "text-stone-600 mt-4"
|
||||
"359 lines. The key functions: " (code "z3-sort") " maps SX types to SMT-LIB sorts. " (code "z3-expr") " recursively translates expressions — identity ops pass through unchanged, " (code "max") "/" (code "min") " become " (code "ite") ", predicates get renamed. " (code "z3-translate") " dispatches on form type. " (code "z3-translate-file") " filters and batch-translates."))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user