r/Clojure • • Nov 29 '22

Why your REPL experience sucks - Article for intermediate Clojure developers

https://srasu.srht.site/var-evaluation.html
77 Upvotes

9 comments sorted by

15

u/PercyLives Nov 29 '22

Having bookmarked but not yet read it, let me just say thank you for contributing this. Material for intermediate developers is very valuable.

10

u/Suskeyhose Nov 29 '22

I hope you find it useful! Let me know what you think of it once you're able to get around to it, I'm always looking for feedback on my writing so I can incorporate it into the next project.

7

u/[deleted] Nov 30 '22

great write up, thanks! i have indeed run into this a few months ago and found a brief answer on clojureverse but your longer form answer i find much better for a deeper understanding

2

u/CyrikDC Nov 30 '22

I like the post. As a slight criticism, I'd move "6. When This Applies" before all the technical explanations so that beginners can get the benefits without having to understand the technical parts. Oh and I'd probably change the wording of the introduction a little. It sounded to me like the article would cover more advanced stuff than var quoting, like protocols or deftypes, which build up an expectation that didn't happen :)

2

u/Suskeyhose Nov 30 '22

Hey, thanks for the criticism! I'll think about an edit to address those.

It's a good point about 6 though, that was a last minute addition and i didn't think too much about where in the flow it belonged.

4

u/NaiveRound Nov 30 '22

I really appreciate the intermediate-level material.

1

u/NaiveRound Nov 30 '22

Are there any tools or libraries that folks recommend to avoid these types of REPL issues? Some type of "reset namespace", with dependent namespaces, and whatever else is necessary?

4

u/Suskeyhose Nov 30 '22

So tools.namespace has refresh which is really common but the workflows people build around these are based on the idea of reloading the whole codebase on every change. The article is about allowing you to update the application not just without losing state saved in globals but also in execution state. No need to pause threads, bounce servers, or anything else, as long as you choose the usage of var quote carefully.

1

u/NaiveRound Nov 30 '22

thank you very much, that puts things in better context for me :)