Replies: 2 comments
|
Found the cause and implemented a fix. Branch, since PRs are closed on this repo: https://github.com/BuddhiLW/ClojureWasm/tree/fix/nrepl-toplevel-do CauseMy first read of this was wrong. It is not that nREPL takes a different eval path from
Fix
Tests
The last one pins the path that was already correct, since the fix moves shared code underneath it. Verified as a real net: with
Measured on |
|
Thanks — and your second read was the right one: this was never two eval paths, it was Your report also turned up a fourth entry point neither of us had tested: The thing your two reports have in common is a class: a shared-engine capability that some entry point does not reach. It is invisible to per-entry-point tests, because each suite passes — what is wrong is that they disagree. So there is now a differential oracle for it ( One thing you should know, since you are building on this: as of today the README says ClojureWasm is no longer maintained. A from-scratch Clojure runtime turned out to be more than one person can sustain. That is not a reaction to anything in these threads — the opposite, if anything: three precise reports with working fixes in two days is the best send-off I could have asked for, and it is why these landed rather than sat. The code stays up under EPL-2.0. |
Uh oh!
There was an error while loading. Please reload this page.
cljw -eandcljw nrepldisagree on a top-leveldothat requires before it uses.Repro
Same code over nREPL:
JVM Clojure and cljrs both return
"OK", and so doescljw -e. Only the nREPL path fails, so this is not the language semantics, it is the two entry points evaluating differently.Why it matters
This is the shape editor tooling sends. Our MCP layer spawns
cljw nreplfor CIDER-style sessions, and a client that wraps a require and its first use in onedo(a very common way to send a region) gets a name error that does not reproduce from the CLI. The workaround is to split into two separate top-level evals, which is fine once you know, and mystifying until you do.Where I would look
src/app/eval_session.zigevalSourcereads and evaluates form by form, and the-epath goes through it. Whatever the nREPL eval op uses appears to analyse the whole form before running any of it, so the alias created by therequireis not visible to the analyser when it reachess/upper-casein the same form.I have not written a fix, since the right shape depends on whether nREPL should route through
evalSourceor whether the analyser should defer alias resolution. Say which you would prefer and I will send a PR.Measured on
faa1bd90(ReleaseFast). Filing here since issues are disabled on the repo.All reactions