deps.edn resolution + a file loader + a project-aware CLI

joltc grew from a single -e expression into a real project runner. require now
loads a namespace's .clj/.cljc from the source roots transitively (load-once),
so a multi-file project works; the corpus/unit gates load compile-eval.ss but
not the loader, so their alias-only require is unchanged.

jolt.deps resolves a deps.edn into ordered source roots — git + local deps only
(no Maven), breadth-first so a top-level pin wins, with aliases (:extra-paths/
:extra-deps/:main-opts) and tasks. Git deps clone into a sha-immutable cache
($JOLT_GITLIBS, else ~/.jolt/gitlibs) by shelling out to git via a new
jolt.host/sh primitive. jolt.main dispatches run -m / -M:alias / -A / repl /
path / a deps.edn task. The launcher passes the user's cwd as JOLT_PWD (the
project dir) since it cd's to the repo root for the runtime's relative loads.
This commit is contained in:
Yogthos 2026-06-22 02:06:05 -04:00
parent 85cec65937
commit 7e2704642b
5 changed files with 451 additions and 29 deletions

View file

@ -1,14 +1,19 @@
#!/bin/sh
# joltc (jolt-9phg, inc9b) — the pure-Chez jolt runtime. NO Janet.
# joltc — the pure-Chez jolt runtime. NO Janet.
#
# Runs a Clojure expression through the zero-Janet spine on Chez, using the
# checked-in bootstrap seed (host/chez/seed/). With only Chez installed and no
# Janet anywhere, this compiles and evaluates jolt code end to end.
# Compiles and evaluates jolt (Clojure) on Chez using the checked-in bootstrap
# seed (host/chez/seed/). With only Chez installed it runs jolt end to end:
#
# bin/joltc -e "(+ 1 2)"
# joltc -e "(+ 1 2)" evaluate an expression
# joltc run -m app.core [args] resolve deps.edn, run a namespace's -main
# joltc -M:alias [args] run an alias's :main-opts
# joltc repl | path | <task> REPL, print roots, or a deps.edn task
#
# (bin/jolt-chez is the older Janet-hosted -e path still used as the corpus oracle;
# joltc is the fully self-hosted runtime.)
# The launcher cd's to the jolt repo root so the runtime's relative loads work;
# the user's original cwd (the project dir, where deps.edn lives) is passed in
# JOLT_PWD.
root="$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)"
JOLT_PWD="${JOLT_PWD:-$PWD}"
export JOLT_PWD
cd "$root" || exit 1
exec chez --script host/chez/cli.ss "$@"