SlideShare a Scribd company logo
Analysis of Zinc
Eugene Yokota (@eed3si9n)

Lightbend
everything changes
separate compilation
separate compilation
A.scala
A.class B.scala
B.class
separate compilation
A.scala
A.jar B.scala
B.class
A.scala
A.class B.scala
B.class
A.sig
"Types are a property of expressions
and thus exist [only] at compile time"
— Creative Scala, Gurnell and Welsh
A.scala
A.class B.scala
B.class
A.sig
"I turned myself into a pickle, Morty!"
— Rick and Morty
incremental
(re)compilation =
minimality
• compiles sources at most once per build

only if they transitively depend on
sources that changed since the previous
build
naïve incremental
(re)compilation
A.scala B.scala C1.scala
C3.scala
C2.scala
C4.scala
• step 1
naïve incremental
(re)compilation
• step 2
A.scala B.scala C1.scala
C3.scala
C2.scala
C4.scala
initial invalidation
naïve incremental
(re)compilation
• step 3
A.scala B.scala C1.scala
C3.scala
C2.scala
C4.scala
transitive invalidation
naïve incremental
(re)compilation
• step 3
A.scala B.scala C1.scala
C3.scala
C2.scala
C4.scala
problem: results to compiling
all/most sources in the graph
name hashing
name hashing
• created by Grzegorz Kossakowski in
2013 (sbt/sbt#1026)
name hashing
• we need to prevent invalidation from
spreading like a wildfire
name hashing
• step 1 (initial compilation)
A.scala B.scala C1.scala
C3.scala
C2.scala
C4.scala
• inheritance (strong)
• member ref (weak)
name hashing
• step 2
A.scala B.scala C1.scala
C3.scala
C2.scala
C4.scala
• collect method signatures and
other information
name hashing
• step 3 (second compilation)
• compile initial invalidation

• update signature info for A
A.scala B.scala C1.scala
C3.scala
C2.scala
C4.scala
name hashing
• step 4
API changes: compare the
signature information before and
after compilation
A.scala B.scala C1.scala
C3.scala
C2.scala
C4.scala
name hashing
• step 5
member ref: transitively invalidated
only if a "used name" changed its
signature
A.scala B.scala C1.scala
C3.scala
C2.scala
C4.scala
name hashing
• step 4
inheritance: always transitively
invalidated
A.scala B.scala C1.scala
C3.scala
C2.scala
C4.scala
name hashing
package example
class B {
def foo: Unit = {
val a = new A
a.something
}
}
package example
class A {
def something: Int = 0
}
name hashing
used names:
example.B -> "A
example.B -> "AnyRef
example.B -> "B
example.B -> "Int
example.B -> "Object
example.B -> "Unit
example.B -> "a
example.B -> "example
example.B -> "example;A;init;
example.B -> "java;lang;Object;init;
example.B -> "scala
example.B -> "something
name hashing
package example
class B {
def foo: Unit = {
val a = new A
a.something
}
}
package example
class A {
// was 0
def something: Int = 2
}
• body change doesn't matter
name hashing
package example
class B {
def foo: Unit = {
val a = new A
a.something
}
}
package example
class A {
def something: Int = 0
// new
def somethingElse: Int = 1
}
• unused names do not matter
name hashing
package example
class C extends A {
def something: Int = 1
}
package example
class A {
def something: Int = 0
// new
def somethingElse: Int = 1
}
• inheritance propagates
invalidation
name hashing
• implementation body changes

• changes to unused methods / vals
prevents invalidation spread based on
dependency origins
subprojects local library JARs
• we only need
signature (API)
changes from
upstream
next steps
liberation from a machine
liberation from a machine
2 items
/Users/eed3si9n/work/zinc-example/A.scala -> /Users/eed3si9n/work/zinc-
example/target/scala-2.13/classes/example/A.class
/Users/eed3si9n/work/zinc-example/B.scala -> /Users/eed3si9n/work/zinc-
example/target/scala-2.13/classes/example/B.class
library dependencies:
4 items
/Users/eed3si9n/work/zinc-example/A.scala -> /Users/eed3si9n/.coursier/
cache/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.1/
scala-library-2.13.1.jar
/Users/eed3si9n/work/zinc-example/A.scala -> /Users/eed3si9n/.sdkman/
candidates/java/8.0.222.hs-adpt/jre/lib/rt.jar
/Users/eed3si9n/work/zinc-example/B.scala -> /Users/eed3si9n/.coursier/
cache/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.1/
scala-library-2.13.1.jar
/Users/eed3si9n/work/zinc-example/B.scala -> /Users/eed3si9n/.sdkman/
candidates/java/8.0.222.hs-adpt/jre/lib/rt.jar
library class names:
2 items
/Users/eed3si9n/.coursier/cache/v1/https/repo1.maven.org/maven2/org/scala-
lang/scala-library/2.13.1/scala-library-2.13.1.jar -> scala.Int
/Users/eed3si9n/.sdkman/candidates/java/8.0.222.hs-adpt/jre/lib/rt.jar ->
java.lang.Object
repeatable build = build as function
sbt/zinc#712
(modular) incremental build pipelining
sbt/zinc#744
subprojects local library JARs
parser
etc
typer, pickler etc jvm
refcheck,
erasure
parser
etc
typer, pickler etc jvm
refcheck,
erasure
parser
etc
typer, pickler etc jvm
refcheck,
erasure
early/foo.jar
early/bar.jar
Thank You and stay healthy!
2020.03 mixtape
COVID-19 real-time update in US (https://
coronavirus.1point3acres.com/en)
Coronavirus update and guidance (https://
www.flattenthecurve.com/)

More Related Content

What's hot

What's hot (10)

Scala for C# Developers
Scala for C# DevelopersScala for C# Developers
Scala for C# Developers
 
Dynamically Composing Collection Operations through Collection Promises
Dynamically Composing Collection Operations through Collection PromisesDynamically Composing Collection Operations through Collection Promises
Dynamically Composing Collection Operations through Collection Promises
 
CocoaConf DC - Automate with Swift - Tony Ingraldi
CocoaConf DC -  Automate with Swift - Tony IngraldiCocoaConf DC -  Automate with Swift - Tony Ingraldi
CocoaConf DC - Automate with Swift - Tony Ingraldi
 
Why I don’t want to develop iOS apps in Objective C
Why I don’t want to develop iOS apps in Objective CWhy I don’t want to develop iOS apps in Objective C
Why I don’t want to develop iOS apps in Objective C
 
Swift, a quick overview
Swift, a quick overviewSwift, a quick overview
Swift, a quick overview
 
Advanced Reflection in Pharo
Advanced Reflection in PharoAdvanced Reflection in Pharo
Advanced Reflection in Pharo
 
Reflection in Pharo: Beyond Smalltak
Reflection in Pharo: Beyond SmalltakReflection in Pharo: Beyond Smalltak
Reflection in Pharo: Beyond Smalltak
 
Reflection in Pharo: Beyond Smalltak
Reflection in Pharo: Beyond SmalltakReflection in Pharo: Beyond Smalltak
Reflection in Pharo: Beyond Smalltak
 
2CPP04 - Objects and Classes
2CPP04 - Objects and Classes2CPP04 - Objects and Classes
2CPP04 - Objects and Classes
 
Lessons Learned: Scala and its Ecosystem
Lessons Learned: Scala and its EcosystemLessons Learned: Scala and its Ecosystem
Lessons Learned: Scala and its Ecosystem
 

Similar to Analysis of Zinc (nescala 2020)

Lecture 14 (inheritance basics)
Lecture 14 (inheritance basics)Lecture 14 (inheritance basics)
Lecture 14 (inheritance basics)
Abhishek Khune
 
Java basics with datatypes, object oriented programming
Java basics with datatypes, object oriented programmingJava basics with datatypes, object oriented programming
Java basics with datatypes, object oriented programming
kalirajonline
 

Similar to Analysis of Zinc (nescala 2020) (20)

About Python
About PythonAbout Python
About Python
 
106da session5 c++
106da session5 c++106da session5 c++
106da session5 c++
 
Lecture 14 (inheritance basics)
Lecture 14 (inheritance basics)Lecture 14 (inheritance basics)
Lecture 14 (inheritance basics)
 
02 java basics
02 java basics02 java basics
02 java basics
 
java02.ppt
java02.pptjava02.ppt
java02.ppt
 
lecture-a-java-review.ppt
lecture-a-java-review.pptlecture-a-java-review.ppt
lecture-a-java-review.ppt
 
lecture-a-java-review.ppt
lecture-a-java-review.pptlecture-a-java-review.ppt
lecture-a-java-review.ppt
 
lecture-a-java-review.ppt
lecture-a-java-review.pptlecture-a-java-review.ppt
lecture-a-java-review.ppt
 
Java basics with datatypes, object oriented programming
Java basics with datatypes, object oriented programmingJava basics with datatypes, object oriented programming
Java basics with datatypes, object oriented programming
 
lecture-a-java-review.ppt
lecture-a-java-review.pptlecture-a-java-review.ppt
lecture-a-java-review.ppt
 
lecture-a-java-review.ppt
lecture-a-java-review.pptlecture-a-java-review.ppt
lecture-a-java-review.ppt
 
lecture-a-java-review.ppt
lecture-a-java-review.pptlecture-a-java-review.ppt
lecture-a-java-review.ppt
 
Scala in Practice
Scala in PracticeScala in Practice
Scala in Practice
 
Introduction to Scala
Introduction to ScalaIntroduction to Scala
Introduction to Scala
 
Scala, Play 2.0 & Cloud Foundry
Scala, Play 2.0 & Cloud FoundryScala, Play 2.0 & Cloud Foundry
Scala, Play 2.0 & Cloud Foundry
 
Java inheritance
Java inheritanceJava inheritance
Java inheritance
 
Object-Oriented Programming with PHP (part 1)
Object-Oriented Programming with PHP (part 1)Object-Oriented Programming with PHP (part 1)
Object-Oriented Programming with PHP (part 1)
 
Practical PHP 5.3
Practical PHP 5.3Practical PHP 5.3
Practical PHP 5.3
 
29csharp
29csharp29csharp
29csharp
 
29c
29c29c
29c
 

More from Eugene Yokota

More from Eugene Yokota (12)

Equality in Scala (ScalaMatsuri 2020)
Equality in Scala (ScalaMatsuri 2020)Equality in Scala (ScalaMatsuri 2020)
Equality in Scala (ScalaMatsuri 2020)
 
sbt: core concepts and updates (Scala Love 2020)
sbt: core concepts and updates (Scala Love 2020)sbt: core concepts and updates (Scala Love 2020)
sbt: core concepts and updates (Scala Love 2020)
 
sbt core concepts (ScalaMatsuri 2019)
sbt core concepts (ScalaMatsuri 2019)sbt core concepts (ScalaMatsuri 2019)
sbt core concepts (ScalaMatsuri 2019)
 
pull requests I sent to scala/scala (ny-scala 2019)
pull requests I sent to scala/scala (ny-scala 2019)pull requests I sent to scala/scala (ny-scala 2019)
pull requests I sent to scala/scala (ny-scala 2019)
 
sbt 1
sbt 1sbt 1
sbt 1
 
sbt server (LSP discussion, 2018 Jan)
sbt server (LSP discussion, 2018 Jan)sbt server (LSP discussion, 2018 Jan)
sbt server (LSP discussion, 2018 Jan)
 
sbt, history of JSON libraries, microservices, and schema evolution (Tokyo ver)
sbt, history of JSON libraries, microservices, and schema evolution (Tokyo ver)sbt, history of JSON libraries, microservices, and schema evolution (Tokyo ver)
sbt, history of JSON libraries, microservices, and schema evolution (Tokyo ver)
 
The state of sbt 0.13, sbt server, and sbt 1.0 (ScalaSphere ver)
The state of sbt 0.13, sbt server, and sbt 1.0 (ScalaSphere ver)The state of sbt 0.13, sbt server, and sbt 1.0 (ScalaSphere ver)
The state of sbt 0.13, sbt server, and sbt 1.0 (ScalaSphere ver)
 
The state of sbt 0.13, sbt server, and sbt 1.0 (ScalaMatsuri ver)
The state of sbt 0.13, sbt server, and sbt 1.0 (ScalaMatsuri ver)The state of sbt 0.13, sbt server, and sbt 1.0 (ScalaMatsuri ver)
The state of sbt 0.13, sbt server, and sbt 1.0 (ScalaMatsuri ver)
 
Thinking in Cats
Thinking in CatsThinking in Cats
Thinking in Cats
 
Road to sbt 1.0: Paved with server (2015 Amsterdam)
Road to sbt 1.0: Paved with server (2015 Amsterdam)Road to sbt 1.0: Paved with server (2015 Amsterdam)
Road to sbt 1.0: Paved with server (2015 Amsterdam)
 
Road to sbt 1.0 paved with server
Road to sbt 1.0   paved with serverRoad to sbt 1.0   paved with server
Road to sbt 1.0 paved with server
 

Recently uploaded

AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
Alluxio, Inc.
 

Recently uploaded (20)

Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
 
top nidhi software solution freedownload
top nidhi software solution freedownloadtop nidhi software solution freedownload
top nidhi software solution freedownload
 
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
 
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBroker
 
AI/ML Infra Meetup | Perspective on Deep Learning Framework
AI/ML Infra Meetup | Perspective on Deep Learning FrameworkAI/ML Infra Meetup | Perspective on Deep Learning Framework
AI/ML Infra Meetup | Perspective on Deep Learning Framework
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
 
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAGAI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
 
Top Mobile App Development Companies 2024
Top Mobile App Development Companies 2024Top Mobile App Development Companies 2024
Top Mobile App Development Companies 2024
 
GraphAware - Transforming policing with graph-based intelligence analysis
GraphAware - Transforming policing with graph-based intelligence analysisGraphAware - Transforming policing with graph-based intelligence analysis
GraphAware - Transforming policing with graph-based intelligence analysis
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
 
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdf
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdfA Comprehensive Appium Guide for Hybrid App Automation Testing.pdf
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdf
 
Breaking the Code : A Guide to WhatsApp Business API.pdf
Breaking the Code : A Guide to WhatsApp Business API.pdfBreaking the Code : A Guide to WhatsApp Business API.pdf
Breaking the Code : A Guide to WhatsApp Business API.pdf
 
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
 
iGaming Platform & Lottery Solutions by Skilrock
iGaming Platform & Lottery Solutions by SkilrockiGaming Platform & Lottery Solutions by Skilrock
iGaming Platform & Lottery Solutions by Skilrock
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
 
Accelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with PlatformlessAccelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with Platformless
 

Analysis of Zinc (nescala 2020)