Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The "Scala is slow to compile" meme needs to die in a fire. At my last job we had a large Scala codebase and it compiles faster then our similarly sized C# project, and much faster then my current gig's much smaller Gradle based Java 8 project. We didn't do anything special: just a standard SBT project and a few logical modules.

As for feature set, we did code reviews across the whole team to keep everyone on the same page. That said, we used a very large part of Scala, and never really made an attempt to keep out of parts of the language. Our biggest battle was always with Scalaz, which we were always on the verge of adding, but never got enough team buyin.



> The "Scala is slow to compile" meme needs to die in a fire.

Martin Odersky has commented many times [1] that scalac won't be as fast as javac. The only link I could find right now is http://stackoverflow.com/questions/3490383/java-compile-spee... which is rather old; but I remember watching more recent videos (< 2 years old) where he makes the same points.


SBT uses incremental compilation. That might account for the difference observed by parent (on incremental builds only)?


> and much faster then my current gig's much smaller Gradle based Java 8 project

Yeah I call BS on that.

Scala's slow compilation doesn't really bother me that much but Java compiles at least ten times faster.


> much faster then my current gig's much smaller Gradle based Java 8 project

> I call BS on that [...] Java compiles at least ten times faster

Then it must be Gradle that's slow, probably the Groovy in it.


> The "Scala is slow to compile" meme needs to die in a fire.

Well said.

Additionally, I think people often forget that the same JVM tuning parameters available for production deployments are available for Scala compilations. These can make a huge difference in build times, especially since the default JVM parameters are understandably conservative.


These tunings are for the runtime, what compiler settings are you referring to?


1. Optimizing JVM parameters can speed up Scala programs.

2. The Scala compiler is itself a Scala program.

1 + 2 => Optimizing JVM parameters can speed up the Scala compiler.


> At my last job we had a large Scala codebase and it compiles faster then our similarly sized C# project, and much faster then my current gig's much smaller Gradle based Java 8 project

I never looked at that way before. We were a shop that used scala and Ruby.

So many of us come from interpretted languages and are used to code and tests reloading with no downtime. How does scalac match up to C# and Java compilation? I'd be interested in seeing the numbers.

Thank you!




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

Search: