Comment by jules
12 years ago
Haskell, OCaml, Erlang, Scala, C#, C, C++ (!) and many others. This really doesn't set Lisp apart any more.
12 years ago
Haskell, OCaml, Erlang, Scala, C#, C, C++ (!) and many others. This really doesn't set Lisp apart any more.
If by Haskell's REPL you mean GHCi, I think it probably qualifies, but it lacks one of the nicer features of a REPL, which is that you can type the same code interactively that you can load from a file. In fact that's how SLIME works with Lisp, by literally copying forms from a Lisp file into the interactive session. If you copy/paste Haskell code out of your .hs files into GHCi you get errors, because the syntax is slightly different, which I find a bit confusing & inconvenient.
Meh. You want to do imperative stuff in the repl, and you can't do that at the top-level in Haskell. The way ghci works is solid. When you are in the ghci repl, you are coding inside the do-notation for the IO monad.
Really, IMHO, jumping back and forth between the editor and the REPL with constant reloading is a better approach than pasting things into the REPL. I remember when I was playing with Common Lisp, I would always have trouble keeping the code on disk and the code loaded into the REPL synced.
>I remember when I was playing with Common Lisp, I would always have trouble keeping the code on disk and the code loaded into the REPL synced.
Then you're doing it wrong. Most people doesn't type directly into the REPL, they open up a separate buffer in Emacs and play in that. The REPL is just for small tests. There is no such thing as 'keeping the code synced'.
4 replies →
The main thing I use a REPL for is playing around with defining/redefining functions and then using them in various ways, and the different syntax plus the weird :{ :} business made that tedious in GHCi. So I ditched it and just moved to the old-school C-style "edit a file, save, compile, run" cycle.
2 replies →
I have used the REPL in all those languages except for Erlang. Trust me. Nothing compares to Common Lisp's Slime. Not all REPLs are equal.
Erlang has Distel, which is a pretty powerful SLIME like mode: https://github.com/massemanet/distel (and written by Luke Gorrie, the same guy who wrote SLIME).
I haven't used either Distel or SLIME extensively enough to say if it's comparable, but it looks fairly similar.
Sadly, true. I would cheerfully murder somebody for something as good as Slime for OCaml.
The CLIs in these languages are mostly not widely used, provide only few features and are poorly integrated in the language.
Plus, most don't implement Lisp's READ EVAL PRINT LOOP, but a simpler command line interface.
Well none of these languages have anything like Lisp's `read`, but Haskell's interactive loop is fairly usable and extensible. You can add vi-like keybindings and interact with other programs like hoogle, which lets you look up things based on types.
Does it provide integrated interactive error handling, break loops, debugging of compiled code, ...
1 reply →
Yes, it is merely an implementation issue as I mentioned in another thread.
What I think still sets Lisp and Smalltalk apart, is their environments at Xerox PARC.
We are still far from having back this type of live editing experience in more mainstream languages.
Oh please. Besides the fact, that CL has a ton of other features which set it apart any of mentioned langs, none of their REPLs are comparable in power. We have interactive debuggers built in and a language designed for it.
Take this simple example:
What is this C++ REPL you speak of?
Try cling (http://root.cern.ch/drupal/content/cling) for just one example based on LLVM.
CINT: http://root.cern.ch/drupal/content/cint
first the practicalities: CINT cannot and is unlikely to ever properly interpret ANSI/ISO C++.
http://www.insectnation.org/howto/problems-with-root
http://linuxfr.org/nodes/18919/comments/632920
https://linuxfr.org/nodes/19928/comments/698692