hey vim-ers! i have a question about tooling/workflows. i hope people have some opinions to share. i've been using vim + fireplace to write clojure for many years. about 6 months ago i switched over to Conjure. it's been mostly great as a much more powerful "REPL". my only gripe is that i cannot seem to configure it to behave as a "eval log". it's not really a REPL, in my opinion. the fact that I can go back and edit / eval previous expressions inside the repl evals/log makes it really hard to trace for myself (and coworkers). by staying disciplined i can make the "eval log" a little easier to follow, but the output of the ; eval (current-form): (... the code ...) is heavily truncated.
maybe my mental model for how a REPL should work just differs from the intent of Conjure? what i'd like to see is this series of steps:
1. eval an expression (by sending it over from source, or typing it out into the repl)
2. see a result that says: "evaluated ... [the entire expression]"
3. see the result of evaluating step 1.
4. hit some keystroke to automatically re-type the previously eval'd expression (or perhaps page through previous expressions)
5. make some changes
6. go to step 1.
is this possible to configure? or do i have to go searching out a different tool?
I've been using fireplace since before it changed names, pretty much with the exact same configuration, and it's been working very well for me. I may not want the same things you do, though, because: > they can revisit a repl session log after a few days and figure out with 100% confidence how they got to where they are sounds like a terrible idea to me.
> probably the biggest downside is that it dumps evals to a quickfix list; its quite handy to be able to eval 2-3 forms and compare them visually in the same page. I don't quite understand that. I never really got familiar with the quickfix list (maybe I should?), but I've never had fireplace force me to use it. The command I use the most with fireplace is a keyboard shortcut I created myself:
nmap ç ya)%a<CR><ESC>pc!!
It's a pretty simple combination of existing commands: it takes the current enclosing form, copies it underneath itself, then replace the copy with the result of its evaluation, in-line. So I end up with what it looks like you want: a form, and then right under it its evaluation result.From there you repl session log feels like a scratch namespace (i.e. (ns scratch ... in scratch.clj).
Though I tend to see the REPL session as a thing that needs to be forgotten: the REPL is there for quick, immediate experimentation, not for the creation of ancient scrolls for future archaeologists to study. If I need some quick eval I create a comment block, eval whatever I need to further my understanding, and then make changes to my code so that understanding is reflected there.
Keeping a log of my REPL sessions has never even crossed my mind. 🤔
(The other shortcut I use very often is crr:
nmap crr :Require
when I have a running application and I want to see the result of my code changes.)Given your requirements, though, have you considered Jupyter and/or Clerk? It's always making me a bit sad when I remember Gorilla doesn't work with recent Clojure versions.
i've tried various paste-buffer/macros/keybind-autocommand "hacks" to get something nearer to the write/eval/read/loop, but every approach seems to have gotch-yas.
What do you like about Conjure over Fireplace?
I mean Conjure is very cool—it makes me willing to write python again if necessary. But other than :EvalAtMark what is Fireplace missing?
fireplace feels very lightweight. that's fine- it's kind of the point. probably the biggest downside is that it dumps evals to a quickfix list; its quite handy to be able to eval 2-3 forms and compare them visually in the same page. i like that conjure can provide a "workspace" -- i can swap to the conjure buffer and make up a namespace, now i have a scratchpad. in fireplace i kind of have to work inside the source, or a comment block in the source. i like that it provides a log of eval'd expressions and results which i can look at side-by-side with the "source under construction". it has good autocompletion. i like that i can hook into tap views pretty easily. there's a ton of built-in power functions like "refreshchanged", "runalltests", "sessionselect", "debug/interrupt", etc. overall it's a much more feature rich solution.
my emacs coworker has what i'd call a "true repl", though. it's an immutable log of eval'd expressions and their results. they can revisit a repl session log after a few days and figure out with 100% confidence how they got to where they are. the fact that conjure allows editing of the "log buffer" (and doesn't spit out the entirety of an eval'd expression) makes this impossible.