Hyperscript compiler/runtime:
- query target support in set/fire/put commands
- hs-set-prolog-hook! / hs-prolog-hook / hs-prolog in runtime
- runtime log-capture cleanup
Scripts: sx-loops-up/down, sx-hs-e-up/down, sx-primitives-down
Plans: datalog, elixir, elm, go, koka, minikanren, ocaml, hs-bucket-f,
designs (breakpoint, null-safety, step-limit, tell, cookies, eval,
plugin-system)
lib/prolog/hs-bridge.sx: initial hook-based bridge draft
lib/common-lisp/tests/runtime.sx: CL runtime tests
WASM: regenerate sx_browser.bc.js from updated hs sources
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
21 lines
662 B
Plaintext
21 lines
662 B
Plaintext
;; lib/prolog/hs-bridge.sx — Prolog ↔ _hyperscript bridge
|
|
;;
|
|
;; Installs the prolog hook into the hyperscript runtime so that
|
|
;; hyperscript scripts can call:
|
|
;;
|
|
;; prolog(db, "goal(args)") → true (at least one solution)
|
|
;; → false (no solution)
|
|
;;
|
|
;; Usage:
|
|
;; (pl-install-hs-hook!) ;; call once at startup, after loading both libs
|
|
;;
|
|
;; Depends on:
|
|
;; lib/hyperscript/runtime.sx — provides hs-set-prolog-hook!
|
|
;; lib/prolog/runtime.sx — provides pl-query-one (Phase 3+)
|
|
|
|
(define
|
|
pl-install-hs-hook!
|
|
(fn
|
|
()
|
|
(hs-set-prolog-hook!
|
|
(fn (db goal) (not (= nil (pl-query-one db goal))))))) |