←back to thread

873 points belter | 7 comments | | HN request time: 0.228s | source | bottom
1. ertucetin ◴[] No.42947096[source]
> REPLs are not useful design tools (though, they are useful exploratory tools)

I disagree with this. I’m a Clojure dev, and most of the time, I use the REPL to iterate on features, fix bugs, and refactor, thanks to the fast feedback loop.

I used to be a Java dev—oh god, restarting the whole app after every change made me want to shoot myself in the head. Now, I use the REPL to build what I want and then move on. This brings joy back to programming.

I’m not saying other languages are bad, but working with Clojure is more enjoyable for me. I’m at least 2-3 times faster than I was with Java. Of course, there are techniques you need to know to write efficient and idiomatic functional code.

replies(5): >>42947281 #>>42947566 #>>42951218 #>>42954166 #>>42957162 #
2. nickpeterson ◴[] No.42947281[source]
I could definitely see how if you work in Java or C# all day, repls feel like a neat curiosity. Picture telling someone who writes scheme in emacs that repls aren't a good design tool.

If you want to argue the point with non lisp people, I'd go to javascript or SQL as great examples where you really use repl's quite a bit.

3. cess11 ◴[] No.42947566[source]
I'm a heavy REPL/interactive shell user so when I do Java I abuse the testing framework, basically I put my sketches in unit tests and run those. The feedback loop is pretty tight, close to what I get in some other languages, whatever happens behind the scenes in IntelliJ it's much shorter than a full recompile and boot.

Supposedly there are some Java shells around but I haven't tried them out.

replies(1): >>42947931 #
4. skydhash ◴[] No.42947931[source]
You either REPL or do TDD.
5. smallerfish ◴[] No.42951218[source]
Apparently Graal lets you hotswap. I tried getting it working about a year ago, but couldn't figure out how to install it with Gradle toolchains, so gave up at that point. I should probably look at it again. Anybody using this?

https://www.graalvm.org/latest/reference-manual/espresso/hot...

6. iLemming ◴[] No.42954166[source]
Well, because Clojure actually has a "proper" REPL. Non-lispy languages don't have such REPLs, at best - they are interactive shells. The blogpost author doesn't seem to have experience with homoiconic languages, otherwise, I'm sure, that sentence would be different.
7. taeric ◴[] No.42957162[source]
Java has been able to hot swap code since the beginning? Well, maybe not the beginning. But very early versions.

The standard runtime didn't like some redefinition. But there were alternatives. Eclipse, for example, would purposely let you get otherwise broken code running so that you could breakpoint and replace as you went.