Code Monkeyism

Programming is hard by Stephan Schmidt

Scala and IntelliJ IDEA

I’ve played around with the latest Scala plugin for IntelliJ IDEA and I consider it alpha quality at best. It’s hard to get compilation going and it gets often confused with parsing (for very basic files, 10 lines of Scala with annotations for Jersey this time). It feels like Eclipse which will also present errors which are none (for Java!) and after inserting a blank line and saving again, the errors go away.

Scala is harder to parse (type inference, implicits, …) than Java, but this needs to get better to be usable. They hinted that it’s too far behind to get into 8.0, I hope not to far.

But kudos for supporting Groovy, JRuby and Scala and doing their best.

Update: I have the nagging thought in the back of my head and a eerie feeling in my stomach that IDEA can’t to better for Scala than for Groovy because of implicits etc. Hope I’m wrong :-)

Update 2: An update to the Scala plugin destroyed my IDE, it is no longer able to start. It says I should remove the plugin, but doesn’t tell me where it is.

About the author: Stephan Schmidt is currently a team manager at ImmobilienScout24 in Berlin. Stephan has been working as a head of development and CTO. He has used a lot of different technologies in the last 20 years including Java, Rails and Python. Stephans main field of interest is maintainablity and productivity in software development. Want to know more? All views are only his own.

If you did like this article but you don't want to subscribe to new articles with your reader, you can follow me on Twitter or subscribe to new posts with your email:

Comments

Theoretically speaking, there’s no reason that implicits would make it *impossible* to implement an IDE that is functionally superior to one implemented for a dynamic language. That’s not to say that it’s easy or always algorithmically efficient, but I don’t think there’s any danger of impossibility on the horizon.

stephan

Daniel: You’re right of course. But what I meant with “can’t do better”:

An Ruby IDE could just listen to the runtime VM and all unit tests and gather most of the needed information.

I fear that implementing type inference in IDEA and scanning the whole classpath for implicits etc. is not much easier than listening to a running Ruby VM and therefore might take a long time / big effort to implement.

Are implicits scoped? Perhaps it’s good to have them some classes or traits. This would prevent the open classes problem of Ruby and make it easier for IDEs. Hmm.

> Are implicits scoped? Perhaps it’s good to have them
> some classes or traits. This would prevent the open
> classes problem of Ruby and make it easier for IDEs. Hmm.

Quite so. :-) Implicits are scoped and have to be explicitly imported (or inherited) from where they are defined. If the function itself is not available *unqualified* in your current referencing context, then the conversion is inapplicable. I haven’t written any tooling for Scala, but I would imagine that you are right about it making it easier on IDE writers.

I posted some comments regarding IntelliJ here

http://stephan.reposita.org/archives/2008/09/17/scala-and-netbeans/

Leave a Reply