3 ms·
I don't have much to add to this discussion except to say that after years of repl-driven development in Clojure I've switched to Ruby as my primary language, a
by mbil 6y ago
I don't have much to add to this discussion except to say that after years of repl-driven development in Clojure I've switched to Ruby as my primary language, and the iteration cycle is just really slow. I feel like I've traded in my fighter jet for a commuter car.
- jimbokun 6y agoHow would you contrast developing with the Clojure REPL compared to irb? I've found irb to be pretty useful for some quick and dirty tasks, albeit not the same level as Clojure (or most Lisps, really).
- mbil 6y agoMy experience with IRB has been so-so. I've found it fine for experimenting with small functions as I develop them, poking at interfaces, etc. But it's really nowhere near the experience I had with Clojure and a repl-integrated programming environment. I've only been using Ruby on Rails for a little under a year, so I have some more learning to do, but I'm not hopeful about the productivity story. Repl-driven development in Clojure with Emacs and CIDER [0]: You develop a namespace or two at a time and you're looking at a handful of files in your editor. You can move between function definitions, modify them, and re-evaluate them as easily as moving the cursor and pressing a key. The whole editor becomes a playground: every piece of code you see can be changed and evaluated as fast as you can think. You can execute a web request from cURL or the browser, and your Clojure repl is hooked into the running program. So you can capture real inputs, store them in temporary vars, play them back, change them on the fly, etc. The IRB is just very linear in comparison. [0]: https://cider.mx/ https://cider.mx/
- Plugawy 6y agoThe closest thing you can get in irb, is to use Rails' `reload!` after making changes to your files. I don't remember if irb supports this kind of stuff out of the box, perhaps good old `require` works. Differences: - Clojure has namespaces, so you can reload just one unit rather than the whole code - I guess load/require would be closest - You can also just evaluate a single form (e.g. a function definition) leaving everything else intact - if you're using something like Component for state management, then you never restart the repl, just stop the system, refresh your repl state and start the system again - closest thing to 'refresh on request' from Rails' dev mode or PHP, but without the nasty surprises The drawback is that restarting a repl is a slow process, but it's something you do very rarely. Some folks keep their repl process around for weeks.