Hacker News new | ask | show | jobs
by TacticalCoder 60 days ago
> Yes, but without a clean REPL you can't easily be sure that your var definitions are what you think they are.

vars and functions too. It's the biggest issue: the inevitable mismatch after a while.

As soon as I've got any doubt there might be a stable cache or a mismatch, I'll just "nuke the current CIDER buffers and relaunch cider-jack-in-clj&cljs". And it takes 1.3 seconds.

I'll also regularly spawn, from a terminal next to my Emacs, all the unit tests related to what I'm working on, in its own JVM / process(es). I'm not talking about running tests on commit (which I can do too). I'm not talking about running tests when I modify a function.

I was there 3000 years ago when Java 1.1 was using green threads on Linux and using Java on Linux required a serious leap of faith (but I knew... I knew it'd take the world... And I knew great things like Clojure would then come).

Now a JVM starts and exits in 40 ms.

Emacs starts and exit, with 4 000 lines of elisp customization I created over the years, in 1.1s.

I cider-jack-in-clj&cljs spawning both a CLJ and a CLJS REPL in 1.3s.

Clojure devs definitely should modify vars and redefine functions at runtime and use the REPL etc.

But there's no need to let a REPL live for one week like GP is suggesting. I can launch my entire app, including Emacs and two REPLs, in 2.5s. While at the same time having all my unit tests being launched in another process.

At 2.5s to "restart the world", there's no reason not to do it more than once a week.

P.S: also stale caches are a thing in this world. It's sad but it's simply how it is. How it's always been. Restarting the whole world, while in dev, helps also deal with a great many stale caches issues that may not be related to Clojure but to other things (e.g. I didn't invent the "disable cache" button in browsers' developer tools and there's a reason it's there).