-1

In my website project, there is conflict right now on using python or scala. One argument that went against scala was its slow compile time whereas Python does not even compile. According to answers given in this question Why does IntelliJ IDEA compile Scala so slowly?

So my question is for a website, what's more important to consider. Slow compile time of a language or slow execution of a language. Is slow compile time of scala an affecting factor? AFAIK compiled code of scala will run faster than interpreted python code.

Note - It's right that languages do not scale but architecture and code does, but it will not hurt to use a language which runs fast.

Community
  • 1
  • 1
codecool
  • 5,886
  • 4
  • 29
  • 40
  • 1
    Also remember premature optimization is the root of all evil – Jakob Bowyer Aug 29 '11 at 11:22
  • 1
    @Jakob Yes I learnt that hard way. – codecool Aug 29 '11 at 11:26
  • Not a direct answer, but if you're looking at compile times then a better comparison would be with a tool such as SBT, which keeps a resident compiler pre-warmed in the JVM and tracks dependencies to only recompile files on demand. IntelliJ's handling of Scala compilation is **not** representative of the language. – Kevin Wright Aug 29 '11 at 19:22
  • I think it's #1 issue that Scala should be improved. Compile time *really* *really* matters – bobzhang Oct 16 '13 at 13:08

2 Answers2

3

With a compiled language you only compile it once. Even in python the bytecode is only generated if the source has changed. I would imagine this is the same with Scala. Looking for which language runs faster is a foolish endeavor as it is "just another language war." Instead of looking for speed you should be looking at frameworks, ease of development, cost of running and upkeep and overall 'friendlyness' of the langauge.

Jakob Bowyer
  • 33,878
  • 8
  • 76
  • 91
  • @codecool yes buddy, this was the exact same thing that I was talking about! check on frameworks, rather than languages. – c0da Aug 29 '11 at 11:15
1

Unless you're expecting the debug-fix-deploy cycle to be the default state, and your app is so huge and coupled that you have to re-compile dozens of the files even after simple changes, build and warmup time shouldn't be really be an issue for a web application. Those frequently stay online for weeks or even months. There's a reason some virtual machines (famously, HotSpot) have called their mode for long-running applications (which includes significantly longer startup/warmup time but allows generation of even better machine code) the "server" mode.

But as you noted yourself, that doesn't mean you have to go use a compiled language. Develop in whatever works best for developing. In the unlikely event you should get enough traffic for the performance of the underlying platform to matter (Twitter had to replace their Ruby code with Scala code for performance, but mind you, it worked well enough for years), you can afford a rewrite anyway ;)