Hacker News new | ask | show | jobs
by programminggeek 4378 days ago
I would be more excited to use Scala if the compile times didn't suck so much. Even on a tiny project, it just feels like it takes too long to do anything.

I guess I'm too used to Ruby and PHP where I save and things happen right away. My test suite runs in less than a second. Stuff like that.

Instead, everything takes 5-10 sec and that just breaks my flow constantly. I used Golang and while I don't love the language I love the compiler a lot. It's really fast and nice and feels like a dynamic language.

Anyhow, Scala compiler has been slow forever and probably will be slow forever. Oh well.

4 comments

This is where IDEs and sbt's ~compile come in handy. I don't hit build very often, since the IDE tells me about my mistakes interactively, and, once it's happy, a build makes for a great micro-break :-)
I agree that for code changes, incremental compilation is usually reasonably painless. Compile times really kill me when I have to do a lot of clean builds, like when modifying my build scripts.
One of the things I was hoping for in improved scala tooling was better IDE agnostic solutions for developers.

For instance, I much prefer to use vim than an IDE, but due to the near requirement to have syntax checking in the editor to avoid long compile cycles I always end up giving up and using an IDE. That a common response to slow tooling complaints is that an IDE hides these issues is an indictment of the scala tool chain.

SBTs upcoming client server split[1] should make such tooling IDE agnostic.

[1] https://github.com/sbt/sbt/wiki/Client-server-split

I agree that the compiler slowness is pretty annoying. A clean build for my project takes more than 30 seconds. That being said, I do appreciate how much the compiler does for me, with the type system and implicits.

I think a faster compiler is coming, but probably not right away. From another comment on this page, it sounds like Scala 3 is going to break source compatibility to remove or improve a lot of the stuff that's holding progress back.

> A clean build for my project takes more than 30 seconds.

Well a C++ clean build would probably take a few hours. I know the projects I worked on did.

Try using sbt/zinc. If you keep cached compiler in memory than you avoid initial startup time. Feels so much better to me.
When was the last time you tried Scala? 2.9 was a bit slow for me, but with 2.11 it feels snappy enough to me.