Add host FFI primitives and web/lib DOM+browser libraries
Introduce 8 irreducible host FFI primitives that replace 40+ native DOM
and browser primitives:
host-global — access global object (window/document)
host-get — read property from host object
host-set! — write property on host object
host-call — call method on host object
host-new — construct host object
host-callback — wrap SX function as host callback
host-typeof — check host object type
host-await — await host promise
All DOM and browser operations are now expressible as SX library
functions built on these 8 primitives:
web/lib/dom.sx — createElement, querySelector, appendChild,
setAttribute, addEventListener, classList, etc.
web/lib/browser.sx — localStorage, history, fetch, setTimeout,
promises, console, matchMedia, etc.
The existing native implementations remain as fallback — the library
versions shadow them in transpiled code. Incremental migration: callers
don't change, only the implementation moves from out-of-band to in-band.
JS 957+1080, Python 744, OCaml 952 — zero regressions.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -98,6 +98,17 @@
|
||||
"*render-check*" "_renderCheck"
|
||||
"*render-fn*" "_renderFn"
|
||||
"is-else-clause?" "isElseClause"
|
||||
"host-global" "hostGlobal"
|
||||
"host-get" "hostGet"
|
||||
"host-set!" "hostSet"
|
||||
"host-call" "hostCall"
|
||||
"host-new" "hostNew"
|
||||
"host-callback" "hostCallback"
|
||||
"host-typeof" "hostTypeof"
|
||||
"host-await" "hostAwait"
|
||||
"dom-document" "domDocument"
|
||||
"dom-window" "domWindow"
|
||||
"dom-head" "domHead"
|
||||
"*batch-depth*" "_batchDepth"
|
||||
"*batch-queue*" "_batchQueue"
|
||||
"*store-registry*" "_storeRegistry"
|
||||
|
||||
Reference in New Issue
Block a user