byte/short/int/long/char silently wrapped or passed out-of-range values through; the JVM range-checks (RT.byteCast family). One checked-cast helper now carries the ranges: a double range-checks ITSELF before truncating ((byte 1.1) is 1, (byte 127.000001) throws), NaN casts to 0, ratios and bigdecs truncate, a non-number is CCE, and the throw carries the JVM message. float range-checks against Float/MAX_VALUE. The unchecked-* casts now genuinely wrap and sign-fold ((unchecked-byte 200) is -56 — the old bit-and lost the sign) with doubles saturating like Java's conversions; unchecked-long/int are host natives. double/float of a bigdec convert instead of crashing. The no-single-float residue stays accepted (SPEC.md). Also fixes #290: a binary built by the SELF-CONTAINED joltc died with 'variable var-deref is not bound' when a namespace loaded at runtime. The in-process build compiled flat.ss against a clean copy-environment, which orphans every top-level define in locations the binary's runtime eval can't see. It now compiles against the default interaction environment (defines land in the real symbol cells, same as the legacy fresh-Chez path) and a generated prologue pre-binds each kernel name the runtime redefines to its kernel value, so the earliest boot reads match the legacy path's primitive references. requiring-resolve is implemented (the issue's dynamic-require pattern), and the release workflow smokes a runtime require in a built binary. Cast namespaces byte/short/int/long/char now fully clean; cts baseline 5805 -> 5857 pass, 67 baselined namespaces. 7 JVM-certified corpus rows. |
||
|---|---|---|
| .. | ||
| image.ss | ||
| prelude.ss | ||
| README.md | ||
Chez bootstrap seed
These two files are the bootstrap compiler for jolt — the seed that makes the build self-hosting:
prelude.ss— theclojure.coreprelude (all tiers + clojure.string/walk/ template/edn/set/pprint) as Schemedef-var!forms.image.ss— the compiler image (jolt.ir+jolt.analyzer+jolt.backend-scheme) as Schemedef-var!forms.
Both are generated, not hand-written. They are checked in because a fresh
checkout must be able to build jolt-on-Chez using only Chez: host/chez/bootstrap.ss
loads this seed, then rebuilds the prelude + image from the .clj/.ss sources via
the on-Chez compiler (read → analyze → emit, all on Chez). The seed is a joint
byte-fixpoint: rebuilding from an up-to-date seed reproduces it exactly.
make selfhost (host/chez/selfcheck.sh) runs host/chez/bootstrap.ss and diffs
the rebuilt artifacts against the checked-in seed.
Re-minting
When the seed sources change (the core tiers, the compiler namespaces, the host
contract, the reader, emit-image.ss), the seed drifts and make selfhost
fails. Re-mint it by running host/chez/bootstrap.ss and writing the freshly
rebuilt prelude/image back to host/chez/seed/prelude.ss /
host/chez/seed/image.ss, then commit the refreshed files.