romanowski.kr@gmail.com
cos Scala compilation is
*compared to java
more advanced static typed languages (e.g. C#, ... ) are also slow
Let's compile more
Usages graphs... TODO
Algorithm:
do Detect changes //TODO Select affected subset of sources //TODO Compile affected sources // scalac.compile(sources) - DONE while there are changes to process
Simple?
Do we need recursion?
// Team.scala class Team { def room = "1" // change to 1 } // User.scala class User(team: Team) { val room: String = team.room // this must fail }
Can incremental compilation be slower then full build?
object A { def a1 = 1 } // A.scala object B { def b1 = A.a1 } // B.scala object C { def c1 = B.b1 } // C.scala object D { def d1 = C.c1 } // D.scala
[info] Compiling 1 Scala source [info] Compiling 2 Scala sources [info] Compiling 2 Scala sources [info] Compiling 4 Scala sources
Why do we compiler 4 sources in the end?
I have never seen such slowdown on production code (without bug in compiler itself).
Class (file) is changed when
It's source file changed It's not-private API changed//TODO example
//TODO example
//TODO compiler plugin
do // Done - detect changed hashes of source or non-private apo Detect changes // TODO Select affected subset of sources // Done - scalac.compile(sources) Compile affected sources while there are changes to process
Example file TODO
//TODO example
//TODO example
//TODO examples
//TODO example
do // Done - detect changed hashes of source or non-private apo Detect changes // Done - Traverse tree and add all sources for all used symbols Select affected subset of sources // Done - scalac.compile(sources) Compile affected sources while there are changes to process
//pseudo code for compile
//pseudo code for changed sources
//pseudo code for changed sources
//pseudo code for compile
//changes in API handling
//changes in dependecies handling
//TODO examples
romanowski.kr@gmail.com