From 0bffc5534f676a3c80c84a02443b81abcd1338a2 Mon Sep 17 00:00:00 2001 From: Yogthos Date: Tue, 9 Jun 2026 13:52:31 -0400 Subject: [PATCH] =?UTF-8?q?core:=20Stage=202=20Task=202=20tier=201=20?= =?UTF-8?q?=E2=80=94=20compile=20syntax-quote=20+=20definterface/extend/pr?= =?UTF-8?q?oxy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit First slice of moving stateful forms onto the compile path (jolt-eaa). - loader stateful-head?: drop syntax-quote (the analyzer's `handled` set already compiles it; routing it to the interpreter was redundant). - host_iface special-names: drop definterface/extend/proxy (stub macros expanding to def/nil — their expansions compile once unpunted). - letfn stays interpreted: its let* expansion needs letrec semantics (mutual recursion between the fns), which sequential compiled let* lacks — a later tier. Gate green: conformance 267x3, fallback-zero 31/5, bootstrap-fixpoint stage1==2==3, self-host, staged-bootstrap, clojure-test-suite >=4034/67, features 78/78, all unit + protocol/multimethod/macro specs. --- src/jolt/host_iface.janet | 6 ++++-- src/jolt/loader.janet | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/jolt/host_iface.janet b/src/jolt/host_iface.janet index d2dbd9e..96574c7 100644 --- a/src/jolt/host_iface.janet +++ b/src/jolt/host_iface.janet @@ -81,8 +81,10 @@ "create-ns" "remove-ns" "find-ns" "all-ns" "the-ns" "resolve" "ns-resolve" "ns-aliases" "ns-imports" "ns-interns" "read-string" "macroexpand-1" "defonce" "ns" "in-ns" "require" - "import" "use" "refer" "defrecord" "defprotocol" "definterface" - "reify" "proxy" "extend-type" "extend-protocol" "extend" "gen-class" + "import" "use" "refer" "defrecord" "defprotocol" + "reify" "extend-type" "extend-protocol" "gen-class" + # letfn stays: its let* expansion needs letrec semantics (mutual + # recursion between the fns), which compiled sequential let* lacks. "monitor-enter" "monitor-exit" "binding" "letfn"] (put t n true)) t)) diff --git a/src/jolt/loader.janet b/src/jolt/loader.janet index a2b9d07..f7608ea 100644 --- a/src/jolt/loader.janet +++ b/src/jolt/loader.janet @@ -9,12 +9,14 @@ # Stateful / context-modifying forms always interpret: they mutate the context # (namespaces, macros, types, multimethods, dynamic vars, …) in ways the compiler # doesn't model. Kept here so the compile/interpret routing lives in one place, -# used by both load-ns and the public eval-one. +# used by both load-ns and the public eval-one. Shrinking toward the frozen +# host-coupled set (Stage 2 jolt-eaa): forms move off this list as they gain a +# compile path; syntax-quote already compiles via the analyzer's `handled` set. (defn- stateful-head? [head-name] (or (= head-name "defmacro") (= head-name "ns") (= head-name "deftype") (= head-name "defmulti") (= head-name "defmethod") (= head-name "require") (= head-name "in-ns") - (= head-name "syntax-quote") (= head-name "set!") + (= head-name "set!") (= head-name "var") (= head-name ".") (= head-name "new") (= head-name "eval")))