Chez Phase 2 (inc I+J): first-class vars + scalar natives
inc I (jolt-n7rz) — vars as first-class objects. (var x)/#'x lowered a :the-var IR op the Chez emitter didn't handle (57 emit-fails, the biggest bucket); emit it to the rt.ss var-cell and shim the static var ops in vars.ss: var?/var-get/deref/var-as-IFn/var =/pr-str (#'ns/name) + a native bound? (the overlay reads (get v :root), nil on a var-cell record). def now RETURNS the var (#'ns/name) like Clojure — def-var!/declare-var! yield the cell, not the value — so (var? (def x 1)) is true and pr-str-of-var/defn pass (un-allowlisted). Dynamic binding (binding/with-bindings*/var-set/ thread-bound?) stays a follow-up; those crash on nil host prims (safe). Var def-time metadata (^:private/^Type/doc) isn't captured yet — allowlisted. inc J (jolt-snry) — scalar natives. natives-misc.ss: a juuid record (random-uuid v4 / parse-uuid / uuid? / #uuid pr-str / str), a %-format engine (%d/%s/%.Nf/%x/%c/%%; printf rides on it), a jtagged record (tagged-literal + :tag/:form + #tag pr-str), bigint/biginteger as near-identity over the all-flonum model. Overlay names (uuid?/random-uuid/ parse-uuid/tagged-literal?) re-asserted in post-prelude.ss. Prelude parity 1898 -> 1951, 0 new divergences. Floor raised to 1951.
This commit is contained in:
parent
6581df2d17
commit
eb26ad0401
6 changed files with 249 additions and 10 deletions
|
|
@ -61,12 +61,9 @@
|
|||
"inf inside coll" true
|
||||
# Phase 2 inc B (jolt-9zhh) made pr-str run; these now render via the readable
|
||||
# FALLBACK instead of the seed's print-method / var semantics — separate gaps:
|
||||
# - def returns the VALUE on Chez, not the var (#'ns/name) — def-returns-var
|
||||
# is a later increment; (pr-str (def x 1)) -> "1" not "#'user/x"
|
||||
# - a custom (defmethod print-method ...) isn't consulted by the Chez printer
|
||||
# (print-method multimethod integration is deferred)
|
||||
"pr-str of a var" true
|
||||
"pr-str of a defn" true
|
||||
# (pr-str of a var / defn now PASS — inc I made def return the var #'ns/name.)
|
||||
"atom override fires nested" true
|
||||
# Phase 2 inc D (jolt-jgoc) made records run; pr-str of a record uses the
|
||||
# built-in #ns.Name{...} form, not a user (defmethod print-method 'ns.Name …)
|
||||
|
|
@ -74,7 +71,14 @@
|
|||
"defmethod overrides a record, top level" true
|
||||
"defmethod fires nested in a map" true
|
||||
"defmethod fires through prn" true
|
||||
"methods table inspectable" true})
|
||||
"methods table inspectable" true
|
||||
# Phase 2 inc I (jolt-n7rz) made (var x)/#'x emit + the static var ops run; a
|
||||
# var's def-time metadata (^:private / ^Type tag / docstring) isn't captured on
|
||||
# the Chez var-cell yet, so (meta (var v)) is nil — var-metadata capture is a
|
||||
# later increment.
|
||||
"^:private on var" true
|
||||
"^Type tag on var" true
|
||||
"(def name doc val) doc" true})
|
||||
|
||||
(def ctx (d/make-ctx))
|
||||
|
||||
|
|
@ -180,8 +184,13 @@
|
|||
# existing into-xform/reduce-seq — unblocks (sequence xform coll), (transduce
|
||||
# xform f coll), and the stateful transducer xforms take-nth/map-indexed/
|
||||
# partition-by that drive a volatile) 1898.
|
||||
# Phase 2 inc I (jolt-n7rz: first-class vars — emit :the-var to the rt.ss var-cell
|
||||
# + var?/var-get/deref/invoke/=/pr-str + bound?; def now RETURNS the var (#'ns/name)
|
||||
# matching Clojure, which also un-allowlists pr-str-of-var/defn) and inc J
|
||||
# (jolt-snry: scalar natives — UUID random-uuid/parse-uuid/uuid?, format/printf,
|
||||
# tagged-literal, bigint) 1951.
|
||||
# Strided runs scale down.
|
||||
(def base-floor (scan-number (or (os/getenv "JOLT_CHEZ_PRELUDE_FLOOR") "1898")))
|
||||
(def base-floor (scan-number (or (os/getenv "JOLT_CHEZ_PRELUDE_FLOOR") "1951")))
|
||||
(def floor (if (os/getenv "JOLT_CORPUS_LIMIT") 0 base-floor))
|
||||
(when (or (> (length diverged) 0) (< pass floor))
|
||||
(printf "REGRESSION: pass %d < floor %d or %d new divergence(s)" pass floor (length diverged)))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue