I have been using Scala for the last two months. I am also using the Play Framework for a small app. I have observed that compilation is very slow even for a program to print \"
Well, this is kind of a duplicate question, but since it contains another, more practical part, I'll try to give an answer nevertheless.
First things first: compilation is slow because the language is rich with features. Of course, there are examples where languages with approximately the same set of features compile faster, but we have what we have. First few things that come to my mind are:
For a much more elaborate answer I refer you to Scala's creator Dr. Odersky himself:.
As for the second part of your question, that depends on how you compile:
scalac
, you can't achieve greater speed since you are bound to separete launches over and over.sbt
, the built-in incremental compiler (server) comes to your service: http://www.scala-sbt.org/0.13.5/docs/Detailed-Topics/Understanding-incremental-recompilation.htmlsbt
), it uses sbt server
as well: https://www.typesafe.com/blog/typesafe-activator-130-released-contains-new-sbt-server-and-uiI think in your case sticking to Activator is the best choice since you already use Play. But remember that this is not a silver bullet: you still get a slow first-time compilation and subsequent runs' speed depends on how much changes you introduced to the code.
Ah, and there's also a hardware side to it. It goes without saying that a powerful CPU, enough RAM and a fast (preferably SSD) disk drive will certainly reduce compilation speed.