5 ms·
> Or do you believe in the other possibility: having a REPL doesn't matter as much as everyone thought? The importance of REPL is very exaggerated. Neither Jav
by laureny 13y ago
> Or do you believe in the other possibility: having a REPL doesn't matter as much as everyone thought?
The importance of REPL is very exaggerated. Neither Java, C#, C++ nor C have one (and together, these four languages probably make up for 95% of programming languages).
There is nothing that prevents any of these languages to get one (Scala has one, a bunch of these exist for other statically typed languages), it's just not that useful when you have powerful IDE's at your disposal.
Most of the time I need REPL-like functionalities, I need it in the heart of my application, with all its structures and state initialized and in the middle of a breakpoint. I hardly ever need to type snippets of code with zero context around them, which is what REPL's offer.
- tensor 13y agoI routinely initialize quite complex states in the repl during development. If anything, it's even more important in that situation since it can often take a long time to get to that state-point in the program.
- bad_user 13y agoThe REPL and IDEs are somewhat orthogonal. IDEs are extremely limited in fact, as they can only rely on static-type info to infer meaningful stuff about how your software will behave. A REPL on the other hand is a runtime instance of your software that you can touch and interact with. Btw, in regards to needing initialized state - code that can't be initialized easily, smells badly. And in Python and Ruby for example, you can stop the execution at any point in your software and initialize the REPL, having complete access to the current context. In Ruby it's as easy as: require 'ruby-debug'; debugger In Python it's as easy as the following (add IPython to the mix for extra awesomeness): import pdb; pdb.set_trace() I'm working with Scala lately and doing the above is a little painful, but I still work with the REPL a lot, in spite of also using IntelliJ IDEA as an IDE. It's true that Java, C# or C/C++ don't have a REPL, but that's why I don't use Java, C# or C/C++ (or Go).
- ryanjshaw 13y agoHuh. The Visual Studio Immediate window [1] has existed since the days of Visual Basic [2]. What are you guys seeing as a REPL that I'm not? [1] http://msdn.microsoft.com/en-us/library/f177hahy(v=vs.71).aspx http://msdn.microsoft.com/en-us/library/f177hahy(v=vs.71).as... [2] http://msdn.microsoft.com/en-us/library/aa716276(v=vs.60).aspx http://msdn.microsoft.com/en-us/library/aa716276(v=vs.60).as...
- bad_user 13y agoWell, it's difficult to see what a REPL is or does, if you're calling Visual Studio's "Immediate Mode" a REPL. It's not. It can evaluate simple expressions, but you can't type arbitrary code in it and hence you can't do arbitrary development in it, so it's not a REPL. The closest thing C# has to a REPL is the Mono C# Shell, built on top of Mono's C# Eval and it's pretty cool, but it's pretty new and raw and needs Mono.
- pjmlp 13y ago> The closest thing C# has to a REPL is the Mono C# Shell, built on top of Mono's C# Eval and it's pretty cool, but it's pretty new and raw and needs Mono. So what?! Languages and implementations are not the same thing.
- bad_user 13y agoErr, what? So languages are plagued with implementation-specific schematics and in truth, all languages grow up at the same time with their reference implementation and it's the reference implementation that defines that language. Basically, I don't care what the ideal implementation for a language X might look like in 10 years from now, what I care about is (1) what am I able to do with it right now and (2) what's the community's culture like? Lately I've been learning some Clojure. I'm fascinated by how Clojure developers work with the source-code. Emacs is an extremely capable editor, but for Clojure it's a full-fledged IDE and a shell for the REPL and it can do anything you'd expect from an IDE. And the whole workflow is basically typing code, sending that piece of code for evaluation in the REPL, typing in the REPL some quick invocations to see how it works, rinse and repeat. The learning experience is also completely awesome, as for some reason you end up reading a lot of the standard library's implementation - coupled with the REPL on the other side in which to quickly type what you read - the workflow is amazing (though Smalltalk developers are probably laughing at me right now).
- rat87 13y agoThere is a c/c++ repl http://root.cern.ch/drupal/content/cling http://root.cern.ch/drupal/content/cling . For java there is bean shell/groovysh which isn't quite as good. There is a mono repl and there is linqpad for c#. Ive used linqpad and it is very usefull. scala worksheets are also very cool.
- MBlume 13y ago> Most of the time I need REPL-like functionalities, I need it in the heart of my application, with all its structures and state initialized and in the middle of a breakpoint. I hardly ever need to type snippets of code with zero context around them, which is what REPL's offer. This is why we Lisp developers have networked REPLs -- I can start up a remote JVM, in communication with other services, connected to my local vim session. I can dynamically load code into it, start and stop my application, etc, all from my editor. https://github.com/clojure/tools.nrepl https://github.com/clojure/tools.nrepl
- pjmlp 13y ago> Neither Java, C#, C++ nor C have one (and together, these four languages probably make up for 95% of programming languages). C# ==> http://www.mono-project.com/CsharpRepl http://www.mono-project.com/CsharpRepl C++ ==> http://root.cern.ch/drupal/content/cint http://root.cern.ch/drupal/content/cint C ==> http://www.softintegration.com/demos/chstandard/interactiveC.html http://www.softintegration.com/demos/chstandard/interactiveC... Java ==> http://www.javarepl.com/console.html http://www.javarepl.com/console.html People, please pay attention in compiler design classes and don't mix languages with implementations.
- MrBuddyCasino 13y agoAlso, the "Display" tab in Eclipse lets you execute random code while you are attached to a JVM via debugging, in the current breakpoint context - that is like 95% of a repl, imho. Many people don't know this one, and its very useful.
- mratzloff 13y ago> The importance of REPL is very exaggerated. I constantly use REPLs to experiment, verify output of functions, etc. In the case of Go I open the Go Playground at least once a day, often much more.
- jaegerpicker 13y agoThat's a very large blanket statement right there. I code in five main languages Objective-C, Java, Python, Ruby, and a bit of Javascript. I do back-end web system type of dev work (Python, Ruby, JavaScript, Java) and front end UI (iOS, Android, and JavaScript (Backbone, Angular, Ember). I use Intellij and sublime as my ide/code editor. The most productive, easiest to use, and for me most fun to develop in environments are Django, Rails, Node, and front-end JavaScript. That is almost completely because of the application aware REPL. Django's manage.py shell command, Rails rails console command, and Chrome's dev tools are three of the most important developer tools I've ever discovered. I'd LOVE to find an iOS tool with the same power.
- randomdata 13y agoLike another commenter posted, REPLs are best suited for exploration. When you've got data and you're not quite sure what to make of it, or you want to do with it yet. IDEs, while also having their place, do not really fill that gap in any way. I often find myself exploring in a language with a good REPL and then implementing the findings in a language that does not.