Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
My verdict on the Scala language (creativekarma.com)
27 points by mshafrir on Aug 10, 2009 | hide | past | favorite | 11 comments


From Jan 2008.


Yes, this article is very outdated. With regard to the documentation concern, Odersky's Scala book has been out for a while, and I have been skimming it. It seems very thorough and easy to read, full of good examples.


And the comments on the page are really quite comprehensive.


"Another issue that might change, but probably won’t change enough, is mixing Scala and Java. While it certainly can be done, it’s not easy except in the (admittedly important) case of Scala calling Java."

Has this situation improved at all since the language was written?


Mixing Java and Scala is almost seamless.

We use WebWork/Struts2 (Java), and all our new Actions are written in Scala.

We use Guice(Java) to inject objects into Scala.

Thrift also plays nicely with Scala.

Two things that are a bit weird is that we can't use constructor injection w/ Guice, so we have to resort to the following ugly hack:

  @Inject var authenticationService: AuthenticationService = null;
We haven't figured out how to construct a Tuple in Java. So if you have a Scala trait and want to implement it in Java, make sure you don't have use a Tuple return type.


Support for mixed Scala/Java projects improved a lot in Scala 2.7.2, which was released in late 2008, so there aren't problems mixing Scala/Java anymore.

Here's a description of what was added since this article was written:

"The compiler can now parse (but not translate) Java source files. This makes it possible to have mixed Java/Scala projects with recursive dependencies between them. In such a project, you can submit first all the Java and Scala sources to the Scala compiler. In a second step, the Java sources are compiled using the Scala generated .class files and the Scala sources are compiled again using the Java generated .class files."


I had success compiling a small-scale mixed Scala and Java project. scalac takes both .java and .scala sources without much fuss, in my experience. I think this is an area that's improved a lot since the author wrote about it.


I find mixing Scala and Java trivial and my Java is weak. I really don't understand the authors problems.

Edit: Maven does a good job of building mixed Java/Scala systems.


Same; I don't know much Java, but I was able to write an Android / Scala app this weekend without any major problems. (OK, my computer won't recognize my phone and I can't install the app. But it works in the emulator.)

(Scala was probably the easiest language I have ever learned. No new concepts or syntax, just Java with some FP stuff and traits. Basically, everything Java was meant to be and should have been.

But it's really an imperative / OO language with the ability to do FP -- the standard library is not set up for pure FP like Haskell's. For that reason, I continue to prefer Haskell... but if Java compat is necessary, it's a great language.)


sure, netbeans plugin also supoorts mixed java+scala projects now


The verdict that idiomatic Scala is unreadable is questionable. One could say the same about most any language, save Python.

I wouldn't let this piece color your perceptions of Scala. It's evolved a ton since early 2008, and it's too deep a language to fully appreciate in a few hours of experimenting.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: