First of all, the repl is a killer. This is not something that is unique to clojure, but that doesnt make it less good. Beeing able to try out new api’s and fumble forward is great.
Spell checker, man!
I don't understand all the REPL love. To me it's great for goofing around with something you don't understand (like clojure itself, when I started). But where is the option to save the REPL state? When I'm actually working on a project it's back to the old edit-compile-run cycle, because otherwise I lose my work. Granted, the compile is pretty quick, but that's true when I'm writing java code in eclipse.
How useful the REPL is depends on the language. Some languages have a much richer REPL related toolset than others. I'm guessing your experience with REPLs has been with a language such as Python or Ruby which doesn't have a very rich toolset. I agree that in these languages the REPL is mostly useful for trying stuff out. However, if you try some thing like Lisp with SLIME then you will see a very different experience. In SLIME, the REPL lets you interact with your running application. This lets you query/modify the runtime state. This, combined with the ability to hot swap your code, gives you nearly instant feedback for anything you develop.
SLIME gives you some ability to save REPL state in that you can start a REPL with all of your code already loaded (check out the Clojure bulid tool Leiningen and the command 'lein swank'). If you want to save the complete state of a running application you could check out one of the versions of Lisp with image based persistence or Smalltalk.
This has been discussed a fair amount, as well as replaying session transcripts, persisting key data structures easily, some other things i can't remember.
If I wanted to use other versions of Lisp, I would be using them. For my environment (lots of legacy java code) clojure is the right language, and I can't reasonably change to Haskell or Scheme (or whatever) because working from files is a little bit inconvenient.
My point was I hear people gushing about the REPL, but I don't find it that useful because of this one deficiency. It makes me wonder if I'm missing something.
I agree, that would be great. But generally you'd just leave the REPL running in a terminal window for as long as the machine was up (in a screen session perhaps).
Comments
First of all, the repl is a killer. This is not something that is unique to clojure, but that doesnt make it less good. Beeing able to try out new api’s and fumble forward is great.
Spell checker, man!
I don't understand all the REPL love. To me it's great for goofing around with something you don't understand (like clojure itself, when I started). But where is the option to save the REPL state? When I'm actually working on a project it's back to the old edit-compile-run cycle, because otherwise I lose my work. Granted, the compile is pretty quick, but that's true when I'm writing java code in eclipse.
How useful the REPL is depends on the language. Some languages have a much richer REPL related toolset than others. I'm guessing your experience with REPLs has been with a language such as Python or Ruby which doesn't have a very rich toolset. I agree that in these languages the REPL is mostly useful for trying stuff out. However, if you try some thing like Lisp with SLIME then you will see a very different experience. In SLIME, the REPL lets you interact with your running application. This lets you query/modify the runtime state. This, combined with the ability to hot swap your code, gives you nearly instant feedback for anything you develop.
SLIME gives you some ability to save REPL state in that you can start a REPL with all of your code already loaded (check out the Clojure bulid tool Leiningen and the command 'lein swank'). If you want to save the complete state of a running application you could check out one of the versions of Lisp with image based persistence or Smalltalk.
This has been discussed a fair amount, as well as replaying session transcripts, persisting key data structures easily, some other things i can't remember.
http://groups.google.com/group/clojure/browse_thread/thread/...
http://groups.google.com/group/clojure/browse_frm/thread/473...
http://stackoverflow.com/questions/3480377/clojure-namespace...
http://clojure-log.n01se.net/date/2010-01-16.html#i75
If I wanted to use other versions of Lisp, I would be using them. For my environment (lots of legacy java code) clojure is the right language, and I can't reasonably change to Haskell or Scheme (or whatever) because working from files is a little bit inconvenient.
My point was I hear people gushing about the REPL, but I don't find it that useful because of this one deficiency. It makes me wonder if I'm missing something.
I agree, that would be great. But generally you'd just leave the REPL running in a terminal window for as long as the machine was up (in a screen session perhaps).
So... if the machine goes down, I need to rewrite my code? And how do I distribute it?
An excellent question. I've just asked it on Stack Overflow: http://stackoverflow.com/questions/3966925/saving-my-running...