jolt/jolt-core/clojure/core
Yogthos e0442f84e4 errors: user-readable messages and stack traces (jolt-2o7 rounds 1+2)
Before: (+ 1 "a") printed 'could not find method :+ for 1 or :r+ for "a"'
followed by three janet frames pointing at jolt internals. After:

    Error: Cannot add 1 and "a" — + expects numbers
      at app.deep/level3

Round 1 — compiled fns carry their Clojure identity:
- The analyzer's recur target (which doubles as the compiled janet fn's
  name) is now ns/fn-name (_r$app.deep/level3--N), so janet stack traces
  name the user's fns; defn passes the self-name through to fn.
- eval-toplevel re-raises with propagate instead of protect+error — the
  failing fiber's stack was being discarded, which is why every trace began
  at eval-toplevel.
- require/maybe-require-ns route loaded namespaces through the loader's
  compile-or-interpret eval-toplevel via a ctx hook (the evaluator can't
  import the loader). Previously REQUIRED namespaces always ran interpreted:
  slower, and their fns were anonymous in traces.

Round 2 — report-error presents for users (rephrase-inspired):
- The full trace text is stashed at the innermost eval-toplevel boundary
  (janet's debug/stacktrace walks the fiber propagation chain; debug/stack
  cannot), then filtered: _r$ frames demangled to ns/fn-name, jolt-internal
  and [eval] frames dropped. JOLT_DEBUG=1 restores the raw janet trace.
- Message rewrites: janet arithmetic dispatch -> 'Cannot add X and Y — +
  expects numbers'; compiled arity -> Clojure's 'Wrong number of args (N)
  passed to: ns/fn'; nil-call gets an undefined-symbol hint (round 3 will
  fix resolution properly).

6 cli-test rows assert the exact user-visible output. Gate green, suite
4718 steady, bench within noise.
2026-06-12 08:58:08 -04:00
..
00-kernel.clj Compiler research (#10) 2026-06-09 07:30:25 +08:00
00-syntax.clj errors: user-readable messages and stack traces (jolt-2o7 rounds 1+2) 2026-06-12 08:58:08 -04:00
10-seq.clj Compiler research (#10) 2026-06-09 07:30:25 +08:00
20-coll.clj core: print-method is a real multimethod (jolt-g1r); records print canonically 2026-06-11 18:10:11 -04:00
25-sorted.clj core: staged recompile for early defns; keys/vals/empty? leave the seed (jolt-4j3) 2026-06-10 16:16:23 -04:00
30-macros.clj core: defprotocol accepts docstring + keyword options (honeysql) 2026-06-11 22:56:12 -04:00
40-lazy.clj core: lazy realization is shared across walks (once-only effects); pmap family 2026-06-10 19:14:49 -04:00
50-io.clj core: cold tagged-type printing migrates to print-method defmethods 2026-06-11 18:35:21 -04:00