From 62c5060093b48b111cf1c322733bafa62186c254 Mon Sep 17 00:00:00 2001 From: Yogthos Date: Sat, 6 Jun 2026 02:50:59 -0400 Subject: [PATCH] compile by default in the shipped runtime MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The jolt binary now compiles each form to Janet bytecode by default (REPL, file, -e, -m, nrepl). The hybrid path keeps it correct — forms the compiler can't handle fall back to the interpreter — and it's validated at parity with the interpreter across the conformance suite (218/218) and the clojure-test-suite (3932 pass / 124 error vs 3913 / 125). JOLT_INTERPRET=1 forces the interpreter. --- src/jolt/main.janet | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/jolt/main.janet b/src/jolt/main.janet index a9a1f5d..9c823d1 100644 --- a/src/jolt/main.janet +++ b/src/jolt/main.janet @@ -11,7 +11,12 @@ (def jolt-version "0.1.0") -(def ctx (init)) +# Compile by default: the shipped runtime compiles each form to Janet bytecode +# (hybrid — forms the compiler can't handle fall back to the interpreter, so the +# result always matches the interpreter; see compiler.janet / loader/eval-toplevel). +# Set JOLT_INTERPRET=1 to force the tree-walking interpreter (debugging / A-B). +(def compile-default? (not (= "1" (os/getenv "JOLT_INTERPRET")))) +(def ctx (init {:compile? compile-default?})) (ctx-set-current-ns ctx "user") (defn read-line [prompt]