views:

1378

answers:

5

I know this is an exact duplicate, but a year has gone by and Scala seems to be a fast moving thing, so I figure it might be acceptable to ask again:

What is the best IDE for Scala development right now?

+15  A: 

I know the Eclipse plugin is a work in progress and undergoing a complete re-write for Scala 2.8 but I saw a colleague use a nightly-build recently and it was extremely poor.

I use IntelliJ IDEA (the Community Edition 9 is free) and the scala plugin for it is really good. Excellent syntax highlighting, code navigation etc. It's not as good as the Java support but then I wouldn't necessarily expect that. It's good enough that I feel I'm more productive than I would have been in Java!

It has Specs integration and console integration as well.

oxbow_lakes
Jens Schauder
FWIW, IntelliJ is very unintuitive and hard to use. At least the completion works out of the box (unlike Eclipse), but I'm still struggling to *run* "hello world" in IntelliJ (tho it compiles beautifully).
Alex R
@Alex R - I think this is a largely unfair observation: it is *different* from Eclipse and hence it may seem unintuitive because you are used to certain paradigms. I'm also failing to see why you cannot run hello world: CTRL+SHIFT+F10 will run whatever is in scope
oxbow_lakes
IntelliJ IDEA totally fails with Scala 2.8 and CPS. Generally Scala is way better and more deeply integrated in eclipse. However it much more stable in IDEA...
hotzen
+10  A: 

Your main options are a fully fledged IDE like IntelliJ IDEA, NetBeans or Eclipse, or a text editor with some Scala awareness like TextMate or Emacs.

Personally, I like IntelliJ the best. I've been using it for Java development for many years, especially due to its refactoring and code navigation power. The Scala plugin was quite rough to start with, but is improving constantly. It's open source, I've been contributing bug reports and a few bug fixes.

The IDE plugins have all been working hard to be ready for Scala 2.8. It's been a moving target during the last 6 months, especially given that binary compatibility was broken as new features were added. So you might update to a new build of the compiler and then wait for supporting libraries (e.g. specs, scalatest) to be updated and recompiled.

Now that the Scala 2.8 Beta is imminent these problems are less frequent.

IntelliJ implements its own parser and type inference, as it does for Java. This lets it be more tolerant of errors and to immediately understand your code as you are editing. The type inference is not complete yet. Eclipse delegates most of this work to scalac, which means it they should always agree, but the information is only regenerated when you save files and the compiler is re-run. I don't know how NetBeans works in this regard.

retronym
+13  A: 

I tried both Eclipse, NetBeans and IntelliJ IDEA,

  • Eclipse is the worst in my opinion. It is slow, sometimes messes up the syntax highlighting, almost always messes up the autocompletion and the whole IDE gets unresponsive from time to time. I would not recommend it for any kind of use except for self torturing.
  • NetBeans works better than the Eclipse plugin. Better highlighting, much better autocompletion but it has been reporting errors on a fairly complex syntax all over the source. But when i hit run, the code compiles just well. Could not understand why. Another issue is that autocomplete can not suggest private members of classes when you are writing inside the body of that class. Poor!
  • IntelliJ IDEA works just fine. I recommend that if you are seriously leaning against Scala development.

I hope that the Eclipse plugin will be more mature in time but given that it had plenty of time to become mature, I'm not a big fan of the idea. Scala has a great potential, being a well thought, programmer friendly language and running on JVM (which means great performance and high availability) but the poor IDE support is the worst thing for such language. Writing PHP on a simple text editor is acceptable but Scala, with such complex syntax and requirement to use the bloated Java libraries, there is a need of assistance. Maybe the current Scala community with functinal and Java background can not understand this but you can not expect newcomers to easily adopt to such a language instantly.

Anyway, go for IntelliJ IDEA...

Ekin Koc
The issue with Eclipse being that it uses scalac internally to do syntax highlighting. Hence if your code does not compile, it can't be properly highlighted!
oxbow_lakes
Thanks for the info. Obviously, it is not best way to implement highlighting :).
Ekin Koc
I thought the Eclipse plugin used this (non-scalac) for syntax highlighting:http://lampsvn.epfl.ch/trac/scala/browser/scala-plugin/trunk/src/scala/tools/eclipse/ScalaCodeScanner.scala
Matt R
+5  A: 

Right now, IntelliJ's IDEA. And one big difference from now to a year ago is that a free, open source version of IDEA is available.

Personally, I use IDEA CE 9.0.1, but leave compilation&testing to SBT, which I keep running on another window, with cc or ~test.

Daniel
IDEA + SBT is very nice, indeed. Usually, SBT builds considerably faster than IDEA's "make" command. But there are odd cases where the fixed overhead in IDEA's "make" command for Scala is exceeded by SBT's conservative determination of which files actually need recompilation.
Randall Schulz
+5  A: 

In the context of 2.8, I have used Eclipse 3.5.x with the nightly plug-in and IDEA Community Edition 9.0. IDEA has been clearly better for me, except for compilation times. But I use sbt in parallel and it takes care of that.

My main issues with the Eclipse plug-in are:

  • Inability to change my tab settings in Eclipse (though that seems to work for others)
  • Code compiles but some errors are still highlighted and I need to close and reopen the file
  • Auto-completion just returns a lot of choices

I did not have those issues in IDEA 9.0 build #IC-93.13 with the recent plug-in 0.3.385. Additionally IDEA shows me unused import statements.

All plug-ins seem to be evolving quite quickly and are actively developed and I suspect that what is true today may not be in one month. I hope that in a few months from now, we will just be able to use our favorite IDE and have good Scala support.

(note this is a repost of my recent answer to the original question)

huynhjl
What is this SBT? The long build times and also the long start-times for applications are annoying me.
ziggystar
@ziggystar Simple Build Tool http://code.google.com/p/simple-build-tool
Thomas Jung
The unused imports are pretty useless because they don't track implicits properly. That is, if an import brings in an implicut conversion (which you use), IDEA will erroneously mark the import as unused
oxbow_lakes