Has this situation improved at all since the language was written?
Has this situation improved at all since the language was written?
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.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."
Edit: Maven does a good job of building mixed Java/Scala systems.
(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.)