Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scalac behavior - useless scans?

In "Programming in scala" book by Martin Odersky, it explained the reason why scalac seems slow (page 114):

The reason is that every time the compiler starts up, it spends time scanning the contents of jar files and doing other initial work before it even looks at the fresh source files you submit to it.

What is the compilation benefit from scanning jar files everytime any compilation is started? Indeed, if most of developers use FSC (Fast Scala compiler) to avoid this default behavior, why haven't scala's authors removed these scans?

Why doesn't javac behave similarly?

like image 558
Mik378 Avatar asked Nov 29 '12 15:11

Mik378


Video Answer


1 Answers

It is probably because scalac simply calls a class in a .jar file. My guess is that they do not want to create temporary (or cache) files.

like image 52
EECOLOR Avatar answered Oct 31 '22 05:10

EECOLOR