self-host: scaffold portable jolt-core + host/core architecture

Adds doc/self-hosting-architecture.md: the portability design (portable front
end + host back end + host runtime, seam = a minimal host protocol + the IR),
grounded in the CLJS/Clojure-in-Clojure prior art. Decisions locked: minimal host
protocol as the seam; physical split with a jolt-core/ source root.

Adds jolt-core/ as a portable Clojure source root (dev path + embedded into the
binary alongside the rest of the stdlib) and jolt-core/jolt/ir.clj — host-neutral
IR node constructors (vars referenced by name, no host values embedded). Verified
it loads and runs under both interpreter and compiler.
This commit is contained in:
Yogthos 2026-06-06 05:44:12 -04:00
parent 6c61d445fb
commit b1ac427bdd
4 changed files with 185 additions and 2 deletions

View file

@ -30,4 +30,6 @@
(let [acc @{}]
(collect "src/jolt/clojure" "clojure/" acc)
(collect "src/jolt/jolt" "jolt/" acc)
# Portable Clojure core (analyzer/IR/…): jolt-core/jolt/foo.clj -> jolt.foo
(collect "jolt-core" "" acc)
acc))

View file

@ -370,8 +370,9 @@
:current-ns "user"
:compile? compile?
# Ordered roots searched (after the stdlib) to resolve a namespace
# to a .clj/.cljc file. deps.edn resolution appends dep src dirs.
:source-paths @["src/jolt"]
# to a .clj/.cljc file. jolt-core holds the portable Clojure layer
# (analyzer/IR/core); deps.edn resolution appends dep src dirs.
:source-paths @["jolt-core" "src/jolt"]
:compiled-cache @{}
:type-registry @{}
:data-readers (let [dr @{}]