jolt/test/support/lazy-eval.janet
Dmitri Sotnikov d3194aae59
Compiler research (#10)
adds self-hosted compiler is functionally:
 
- The default compile path is the portable pipeline using jolt.analyzer (Clojure) → host-neutral IR → backend.janet.
- The analyzer is itself Clojure, compiled by jolt for true self-hosting.
- bootstrap-fixpoint passes (stage1 == stage2 == stage3): rebuilding the compiler on its own output.
- clojure.core is now self-hosted in the overlay.
- Stateful forms (defmacro/ns/deftype/defmulti/require/in-ns) are interpreted by design.
2026-06-09 07:30:25 +08:00

16 lines
566 B
Text

# Worker: evaluate a Clojure equality check in a fresh Jolt ctx and print
# @@RESULT true or @@RESULT false. Used by lazy-infinite-test under a wall-clock
# deadline so infinite-seq hangs are caught as test failures.
(use ../../src/jolt/api)
(use ../../src/jolt/reader)
(def expected (get (dyn :args) 1))
(def actual (get (dyn :args) 2))
(when (and expected actual)
(def ctx (init {}))
(def prog (string "(= " expected " " actual ")"))
(def [ok val] (protect (eval-string ctx prog)))
(if ok
(printf "@@RESULT %q" val)
(printf "@@ERROR %q" val)))