Slide 1

Slide 1 text

SPORES ECOOP 2014, Uppsala, Sweden August 1st, 2014 Heather Miller A Type-Based Foundation for Closures in the Age of Concurrency & Distribution , Philipp Haller, Martin Odersky

Slide 2

Slide 2 text

SOME MOTIVATION…

Slide 3

Slide 3 text

TWO TRENDS DATA-CENTRIC APPLICATIONS FUNCTIONAL PROGRAMMING APPLY FUNCTIONS TO IMMUTABLE DATA. CLOSURE-HEAVY. CALLBACKS/REACTIVE.

Slide 4

Slide 4 text

OBSERVATION:

Slide 5

Slide 5 text

THESE ARECOMPLIMENTARY TRENDS OBSERVATION:

Slide 6

Slide 6 text

THESE ARECOMPLIMENTARY TRENDS OBSERVATION: FUNCTIONAL PROGRAMMING A BOON TO DATA-CENTRIC PROGRAMMING

Slide 7

Slide 7 text

WHY? The basic philosophy to transform immutable data by applying first-class functions. The observation that this functional style simplifies reasoning about data in parallel, concurrent, and distributed code. 1 2

Slide 8

Slide 8 text

THE OF DATA-PARALLEL POPULARITY FRAMEWORKS HENCE,

Slide 9

Slide 9 text

Spark MapReduce DISTRIBUTED Java 8’s monadic optionally-parallel streams Scala’s parallel collections Haskell’s Par Monad PARALLEL/ CONCURRENT Intel’s Concurrent Collections DATA-PARALLEL FRAMEWORKS

Slide 10

Slide 10 text

WHY SPORES ? ARE NECESSARY

Slide 11

Slide 11 text

Well, CLOSURES ARE OFTEN A SOURCE OF HEADACHES YOU CAN’T REALLY DISTRIBUTE THEM.

Slide 12

Slide 12 text

Well, CLOSURES ARE OFTEN A SOURCE OF HEADACHES NOT JUST IN SCALA OR JAVA. BUT CROSS-PARADIGM. YOU CAN’T REALLY DISTRIBUTE THEM.

Slide 13

Slide 13 text

PROBLEMS 1. Accidental capture of non-serializable
 variables (like this) 2. Language-specific compilation schemes
 that create implicit references to objects
 that are not serializable 3. transitive references that inadvertently hold
 on to excessively large object graphs
 creating memory leaks THELAUNDRY LIST W/CLOSURES

Slide 14

Slide 14 text

PROBLEMS 4. Capturing references to mutable objects,
 leading to race conditions in a concurrent
 setting. 5. Unknowingly accessing object members
 that are not constant such as methods, 
 which in a distributed setting can have 
 logically different meanings on different 
 machines. THELAUNDRY LIST W/CLOSURES CONT’D

Slide 15

Slide 15 text

SPARK motivating example: http://docs.scala-lang.org/sips/pending/spores.html Scala Improvement Proposal: class MyCoolRddApp { val param = 3.14 val log = new Log(...) ... def work(rdd: RDD[Int]) { rdd.map(x => x + param) .reduce(...) } }

Slide 16

Slide 16 text

SPARK motivating example: http://docs.scala-lang.org/sips/pending/spores.html Scala Improvement Proposal: class MyCoolRddApp { val param = 3.14 val log = new Log(...) ... def work(rdd: RDD[Int]) { rdd.map(x => x + param) .reduce(...) } } PROBLEM: not serializable because it captures this of type MyCoolRddApp which is itself not serializable (x => x + param)

Slide 17

Slide 17 text

AKKA/FUTURES def  receive  =  {    case  Request(data)  =>        future  {            val  result  =  transform(data)            sender  !  Response(result)        }   } Akka actor spawns future to concurrently process incoming results AKKA ACTOR SPAWNS A FUTURE TO CONCURRENTLY PROCESS INCOMING REQS NOT A STABLE VALUE! IT’S A METHOD CALL! PROBLEM: motivating example: http://docs.scala-lang.org/sips/pending/spores.html Scala Improvement Proposal:

Slide 18

Slide 18 text

AKKA/FUTURES def  receive  =  {    case  Request(data)  =>        future  {            val  result  =  transform(data)            sender  !  Response(result)        }   } Akka actor spawns future to concurrently process incoming results AKKA ACTOR SPAWNS A FUTURE TO CONCURRENTLY PROCESS INCOMING REQS NOT A STABLE VALUE! IT’S A METHOD CALL! PROBLEM: motivating example: http://docs.scala-lang.org/sips/pending/spores.html Scala Improvement Proposal:

Slide 19

Slide 19 text

Need a solution that… INTEGRATES WITH EXISTING PRACTICE: PRACTICAL FOR INCLUSION/ USE IN FULL-FEATURED SCALA. PRACTICAL FOR INTEGRATION WITH SPARK, AKKA, ETC.

Slide 20

Slide 20 text

Need a solution that… ENABLES LIBRARY AUTHORS TO CONFIDENTLY RELEASE LIBRARIES THAT EXPOSE FUNCTIONS IN USER-FACING APIS without concerns of runtime exceptions or other dubious errors falling on users.

Slide 21

Slide 21 text

ENTER: SPORES

Slide 22

Slide 22 text

ENTER: SPORES PROPOSED FOR INCLUSION IN SCALA.

Slide 23

Slide 23 text

WHAT ARE THEY? A closure-like abstraction GOAL: Well-behaved closures with controlled environments that can avoid various hazards. http://docs.scala-lang.org/sips/pending/spores.html Scala Improvement Proposal: SPORES A type system …designed for use in distributed or concurrent environments.

Slide 24

Slide 24 text

http://docs.scala-lang.org/sips/pending/spores.html Scala Improvement Proposal: SPORES THIS IS ACHIEVED BY: (a) enforcing a specific syntactic shape which dictates how the environment of a spore is declared. (b) providing additional type checking to ensure that types being captured have certain properties.

Slide 25

Slide 25 text

http://docs.scala-lang.org/sips/pending/spores.html Scala Improvement Proposal: SPORES THIS IS ACHIEVED BY: (a) enforcing a specific syntactic shape which dictates how the environment of a spore is declared. (b) providing additional type checking to ensure that types being captured have certain properties. CRUCIALLY, spores encode extra type information corresponding to the captured environment in their type.

Slide 26

Slide 26 text

Contributions spores abstraction & type system type-based constraints that can be combined with existing type systems formalization and soundness proof implementation of spores for Scala small empirical study of practicality

Slide 27

Slide 27 text

Contributions spores abstraction & type system type-based constraints that can be combined with existing type systems formalization and soundness proof implementation of spores for Scala small empirical study of practicality details in the paper… (covered in this presentation)

Slide 28

Slide 28 text

WHAT DO SPORES LOOK LIKE? Basic usage: val  s  =  spore  {      val  h  =  helper      (x:  Int)  =>  {          val  result  =  x  +  "  "  +  h.toString          println("The  result  is:  "  +  result)      }   } THE BODY OF A SPORE CONSISTS OF 2 PARTS 2 a closure a sequence of local value (val) declarations only (the “spore header”), and 1 http://docs.scala-lang.org/sips/pending/spores.html Scala Improvement Proposal

Slide 29

Slide 29 text

WHAT DO SPORES LOOK LIKE? Basic usage: val  s  =  spore  {      val  h  =  helper      (x:  Int)  =>  {          val  result  =  x  +  "  "  +  h.toString          println("The  result  is:  "  +  result)      }   } THE BODY OF A SPORE CONSISTS OF 2 PARTS 2 a closure a sequence of local value (val) declarations only (the “spore header”), and 1 http://docs.scala-lang.org/sips/pending/spores.html Scala Improvement Proposal

Slide 30

Slide 30 text

WHAT DO SPORES LOOK LIKE? Basic usage: val  s  =  spore  {      val  h  =  helper      (x:  Int)  =>  {          val  result  =  x  +  "  "  +  h.toString          println("The  result  is:  "  +  result)      }   } THE BODY OF A SPORE CONSISTS OF 2 PARTS 2 a closure a sequence of local value (val) declarations only (the “spore header”), and 1 http://docs.scala-lang.org/sips/pending/spores.html Scala Improvement Proposal

Slide 31

Slide 31 text

SPORE 1. All captured variables are declared in 
 the spore header, or using capture 2. The initializers of captured variables 
 are executed once, upon creation of 
 the spore 3. References to captured variables do 
 not change during the spore’s execution vsCLOSURES ( ) A Guarantees... http://docs.scala-lang.org/sips/pending/spores.html Scala Improvement Proposal:

Slide 32

Slide 32 text

SPORES&CLOSURES EVALUATION SEMANTICS: Remove the spore marker, and the code behaves as before SPORES & CLOSURES ARE RELATED: You can write a full function literal and pass it to something that expects a spore. (Of course, only if the function literal 
 satisfies the spore rules.) http://docs.scala-lang.org/sips/pending/spores.html Scala Improvement Proposal:

Slide 33

Slide 33 text

HOW CAN YOU USE A SPORE? Ok. So. IN APIS http://docs.scala-lang.org/sips/pending/spores.html Scala Improvement Proposal def  sendOverWire(s:  Spore[Int,  Int]):  Unit  =  ...   //  ...   sendOverWire((x:  Int)  =>  x  *  x  -­‐  2)   If you want parameters to be spores, then you can write it this way

Slide 34

Slide 34 text

WHAT DOES ALL OF THAT http://docs.scala-lang.org/sips/pending/spores.html Scala Improvement Proposal GET YOU? SINCE... 
 Captured expressions are evaluated upon spore creation. ! Spores are like function values with an immutable environment. Plus, environment is specified and checked, no accidental capturing. THAT MEANS...

Slide 35

Slide 35 text

But… SOCKET? WHAT IF I CAPTURE A

Slide 36

Slide 36 text

THIS IS WHERE TYPE SYSTEM COMES IN. THE

Slide 37

Slide 37 text

KEEP TRACK OF CAPTURED TYPES Idea: The spore macro can synthesize precise types automatically for newly created spores: Spore[Int,  ...]  {      type  Excluded  =  No[Actor]      type  Captured  =  (Int,  ActorRef)   } w/ constraints CreatingSPORES ...at compile-time spore  {  val  x:  Int  =  list.size;  val  a:  ActorRef  =  this.sender      (y:  Int)  =>  ...   }  without[Actor] SYNTHESIZED TYPE:

Slide 38

Slide 38 text

w/ constraints ComposingSPORES BASIC COMPOSITION OPERATORS (same as for regular functions) andThen compose How do we synthesize the result type of 
 s1 andThen s2? RESULT TYPE SYNTHESIZED BY andThen MACRO type member Captured: concatenation of the captured types of s1 and s2 type member Excluded: conjunction of excluded types, needs to check Captured type members to see if possible

Slide 39

Slide 39 text

w/ constraints Example:Composing val  s1:  Spore[Int,  String]  {      type  Excluded  =  No[Actor]      type  Captured  =  (Int,  ActorRef)   }  =  ...   val  s2:  Spore[String,  String]  {      type  Excluded  =  No[RDD[Int]]      type  Captured  =  Actor   }   s1  andThen  s2    //  does  not  compile   SPORES

Slide 40

Slide 40 text

w/ constraints Example: SPORES Composing val  s1:  Spore[Int,  String]  {      type  Excluded  =  No[Actor]      type  Captured  =  (Int,  ActorRef)   }  =  ...   val  s2:  Spore[String,  String]  {      type  Excluded  =  No[RDD[Int]]   }   s1  andThen  s2:  Spore[Int,  String]  {      type  Excluded  =  No[Actor]  with  No[RDD[Int]]      type  Captured  =  (Int,  ActorRef)   }   !

Slide 41

Slide 41 text

But… HOW ARE THEY SERIALIZABLE?

Slide 42

Slide 42 text

But… HOW ARE THEY SERIALIZABLE? THEY’RE NOT. YET.

Slide 43

Slide 43 text

PROPERTIES Enter: IDEA: http://docs.scala-lang.org/sips/pending/spores.html Scala Improvement Proposal case  class  Person(name:  String,  age:  Int)   ! val  fun  =  spore  {      val  p:  Person  =  ...      val  luckyNum:  Int  =  ...      ()  =>  s"${p.name}'s  lucky  number  is:  $luckyNum"   } allow expressing a type-based property that must be satisfied by all captured variables upon creation of a spore. EXAMPLE: ENSURE THE FOLLOWING SPORE IS SERIALIZABLE.

Slide 44

Slide 44 text

PROPERTIES Enter: IDEA: http://docs.scala-lang.org/sips/pending/spores.html Scala Improvement Proposal case  class  Person(name:  String,  age:  Int)   ! val  fun  =  spore  {      val  p:  Person  =  ...      val  luckyNum:  Int  =  ...      ()  =>  s"${p.name}'s  lucky  number  is:  $luckyNum"   } allow expressing a type-based property that must be satisfied by all captured variables upon creation of a spore. EXAMPLE: ENSURE THE FOLLOWING SPORE IS SERIALIZABLE. To serialize a spore, it's necessary that for all captured variables of type T, there is an implicit pickler of type Pickler[T] in scope.

Slide 45

Slide 45 text

PROPERTIES Enter: IDEA: http://docs.scala-lang.org/sips/pending/spores.html Scala Improvement Proposal case  class  Person(name:  String,  age:  Int)   ! val  fun  =  spore  {      val  p:  Person  =  ...      val  luckyNum:  Int  =  ...      ()  =>  s"${p.name}'s  lucky  number  is:  $luckyNum"   } allow expressing a type-based property that must be satisfied by all captured variables upon creation of a spore. EXAMPLE: ENSURE THE FOLLOWING SPORE IS SERIALIZABLE. To serialize a spore, it's necessary that for all captured variables of type T, there is an implicit pickler of type Pickler[T] in scope. Pickler[T] CAN BE A SUCH A PROPERTY

Slide 46

Slide 46 text

PROPERTIES Enter: WHAT ARE THEY? http://docs.scala-lang.org/sips/pending/spores.html Scala Improvement Proposal Properties are defined using a type Property[T] Use a property by importing it. When importing a property of type Property[Prop] all spores in scope are guaranteed to satisfy the property or not compile (= all captured types have property Prop)

Slide 47

Slide 47 text

PROPERTIES Enter: WHAT ARE THEY? http://docs.scala-lang.org/sips/pending/spores.html Scala Improvement Proposal Properties are defined using a type Property[T] Use a property by importing it. When importing a property of type Property[Prop] all spores in scope are guaranteed to satisfy the property or not compile (= all captured types have property Prop) so, in the case of pickling, just: import  picklable and the framework ensures that a Pickler[T] exists for every captured type T. (has to have type Property[Pickler])

Slide 48

Slide 48 text

NOT LIMITED TO PICKLING CAN HAVE ARBITRARY PROPERTIES. http://docs.scala-lang.org/sips/pending/spores.html Scala Improvement Proposal …plugs in nicely with other pluggable type systems. Integrate with a deep immutability checker like OIGJ (Zibin et al. 2010) EXAMPLE: DEEP IMMUTABILITY

Slide 49

Slide 49 text

NOT LIMITED TO PICKLING IDEA: http://docs.scala-lang.org/sips/pending/spores.html Scala Improvement Proposal Automatically generate type class instances for all types that satisfy a transitive predicate, using macros. implicit  def  isImmutable[T:  TypeTag]:  Immutable[T] which returns a type class instance for all types of the shape C[O, Immut] that's deeply immutable (analyzing the TypeTag).

Slide 50

Slide 50 text

NOT LIMITED TO PICKLING IDEA: http://docs.scala-lang.org/sips/pending/spores.html Scala Improvement Proposal Automatically generate type class instances for all types that satisfy a transitive predicate, using macros. implicit  def  isImmutable[T:  TypeTag]:  Immutable[T] which returns a type class instance for all types of the shape C[O, Immut] that's deeply immutable (analyzing the TypeTag). To enforce transitive immutability for a spore, it's then sufficient to define an implicit of type Property[Immutable].

Slide 51

Slide 51 text

FORMALIZATION CENTRAL IDEA: Spore types are refinements of function types. | ‹’‘”– pn ‹ t SURSHUW\ LPSRUW | t …‘’‘•‡ t VSRUH FRPSRVLWLRQ v ::= (x : T) ⇒ t DEVWUDFWLRQ | {l = v} UHFRUG YDOXH | •’‘”‡ { x : T = v ; pn; (x : T) ⇒ t } VSRUH YDOXH T ::= T ⇒ T IXQFWLRQ W\SH | {l : T} UHFRUG W\SH | S S ::= T ⇒ T { –›’‡ C = T ; pn } VSRUH W\SH | T ⇒ T { –›’‡ C ; pn } DEVWUDFW VSRUH W\SH P ∈ pn → T SURSHUW\ PDS T ∈ P(T) W\SH IDPLO\ Γ ::= x : T W\SH HQYLURQPHQW ∆ ::= pn SURSHUW\ HQYLURQPHQW HU 3 +DOOHU DQG 0 2GHUVN\ ::= ... WHUPV | •’‘”‡ { x : T = t ; T; pn; (x : T) ⇒ t } VSRUH ::= ... YDOXHV | •’‘”‡ { x : T = v ; T; pn; (x : T) ⇒ t } VSRUH YDOXH ::= T ⇒ T { –›’‡ C = T ; –›’‡ E = T ; pn } VSRUH W\SH | T ⇒ T { –›’‡ C ; –›’‡ E = T ; pn } DEVWUDFW VSRUH W\SH )LJ &RUH ODQJXDJH V\QWD[ H[WHQVLRQV ϿϱЁζ T2 <: T1 R1 <: R2 n′ ⊆ pn M1 = M2 ∨ M2 = –›’‡ C ∀T′ ∈ U′. ∃T ∈ U. T′ <: They include more information than typical functions: properties, excluded, and captured

Slide 52

Slide 52 text

FORMALIZATION This additional information is used when type- checking (assume S1 and S2 are the types of two spores): properties: S1 <: S2 implies S1 must satisfy at least the properties of S2 excluded: S1 <: S2 implies S1 must exclude at least the types that S2 excludes captured: S1 <: S2 implies S2 either has abstract type Captured or S1 and S2 agree on the captured types (Intuition)

Slide 53

Slide 53 text

FORMALIZATION This additional information is used when type- checking (assume S1 and S2 are the types of two spores): properties: S1 <: S2 implies S1 must satisfy at least the properties of S2 excluded: S1 <: S2 implies S1 must exclude at least the types that S2 excludes captured: S1 <: S2 implies S2 either has abstract type Captured or S1 and S2 agree on the captured types (Intuition)

Slide 54

Slide 54 text

FORMALIZATION Sound composition of constraints: avoid calculating constraints that are not guaranteed to hold at runtime SPORE COMPOSITION PRESERVES TYPE CONSTRAINTS …In the paper: ! Soundness proof based on a small-step operational semantics and progress+preservation. ! Correspondence to the Scala implementation

Slide 55

Slide 55 text

HOW ARESPORES PRACTICAL ?

Slide 56

Slide 56 text

MINI EMPIRICAL STUDY #1 + 0LOOHU 3 +DOOHU DQG 0 2GHUVN\ MOOC Parallel Collections Spark ^ ^ ^ EH LQIHUUHG D VHTXHQFH RI W\SHV VSHFLI\LQJ W\SH ERXQGV LV REWDLQHG DV IROORZV %DVL FDOO\ WKH W\SH RI WKH LPSOLFLW YDOXH LV PDWFKHG DJDLQVW WKH SDWWHUQ ”‘’‡”–›ƃ–ɨƄ ™‹–Š ŜŜŜ ™‹–Š ”‘’‡”–›ƃ–Ƅ ZKHUH WKH –‹ DUH W\SH YDULDEOHV )RU HDFK W\SH –‹ DQ LPSOLFLW YDOXH PHPEHU ‹’Ž‹…‹– ˜ƒŽ ‡˜‹ś –‹ƃƒ’–—”‡†Ƅ ʰ ‹’Ž‹…‹–Ž›ƃ–‹ƃƒ’–—”‡†ƄƄ LV JHQHUDWHG DQG DGGHG WR WKH ’‘”‡ UHILQHPHQW W\SH :H DOVR SURYLGH DQ LPSOLFLW FRQYHUVLRQ IURP VWDQGDUG 6FDOD IXQFWLRQV WR VSRUHV 7KLV FRQYHUVLRQ LV LPSOHPHQWHG DV D PDFUR ZKRVH H[SDQVLRQ IDLOV LI WKH DUJXPHQW IXQF WLRQ LV QRW D OLWHUDO VLQFH LQ WKLV FDVH LW LV LPSRVVLEOH IRU WKH PDFUR WR FKHFN WKH VSRUH VKDSHFDSWXULQJ FRQVWUDLQWV (YDOXDWLRQ 3URJUDP /2& FORVXUHV FRQYHUWHG /2& FKDQJHG FDSWXUHG YDUV IXQVHWV IRUFRPS PDQGHOEURW EDUQHVKXW VSDUN SDJHUDQN VSDUN NPHDQV 7RWDO )LJ &RPSDULVRQ WR UHODWHG DSSURDFKHV ,Q WKLV VHFWLRQ ZH HYDOXDWH WKH SUDFWLFDOLW\ RI XVLQJ VSRUHV DV DQ DOWHUQDWLYH WR QRUPDO FORVXUHV LQ 6FDOD E\ PHDVXULQJ WKH QXPEHU RI FKDQJHV UHTXLUHG WR FRQYHUW H[LVWLQJ SUR JUDPV WKDW FUXFLDOO\ UHO\ RQ FORVXUHV WR XVH VSRUHV :H DQDO\]H D QXPEHU RI UHDO 6FDOD SURJUDPV WDNHQ IURP WKUHH FDWHJRULHV *HQHUDO FORVXUHKHDY\ FRGH WDNHQ IURP WKH H[HUFLVHV RI WKH SRSXODU 022& RQ )XQFWLRQDO 3URJUDPPLQJ 3ULQFLSOHV LQ 6FDOD WKH JRDO RI DQDO\]LQJ WKLV FRGH LV WR JHW )LJ (YDOXDWLQJ WKH SUDFWLFDOLW\ RI XVLQJ VSRUHV LQ SODFH RI QRUPDO FORVXUHV YDOXH LV PDWFKHG DJDLQVW WKH SDWWHUQ ”‘’‡”–›ƃ–ɨƄ ™‹–Š ŜŜŜ ™‹–Š ”‘’‡”–›ƃ–Ƅ )RU HDFK W\SH –‹ DQ LPSOLFLW PHPEHU RI WKH IROORZLQJ VKDSH LV DGGHG WR WKH ’‘”‡ W\SH UHILQHPHQW ‹’Ž‹…‹– ˜ƒŽ ‡˜‹ś –‹ƃƒ’–—”‡†Ƅ ʰ ‹’Ž‹…‹–Ž›ƃ–‹ƃƒ’–—”‡†ƄƄ 7KH LPSOLFLW FRQYHUVLRQ 6HFWLRQ IURP VWDQGDUG 6FDOD IXQFWLRQV WR VSRUHV LV LPSOH PHQWHG DV D PDFUR ZKRVH H[SDQVLRQ IDLOV LI WKH DUJXPHQW IXQFWLRQ LV QRW D OLWHUDO VLQFH How much effort is required to convert existing programs that crucially rely on closures to spores? For each closure, we had to change 1.4LOC on average, or only 45/1503 LOC

Slide 57

Slide 57 text

6SRUHV $ 7\SH%DVHG )RXQGDWLRQ IRU &ORVXUHV LQ WKH $JH RI &RQFXUUHQF\ 'LVWULEXWLRQ DYHUDJH /2& DYHUDJH RI FORVXUHV WKDW 3URMHFW SHU FORVXUH FDSWXUHG YDUV GRQ¶W FDSWXUH •ƒ‡‡”ƒ‰ƒ”™ƒŽŵ„Ž‹†„ LOC ˆ”‡‡ƒŞŽƒ„ŵ–Š—†‡” LOC „‹‰†ƒ–ƒ‰‡‘‹…•ŵƒ†ƒ LOC ‘‘›ƒŽƒŵ•’ƒ”ŞŒ‘„•‡”˜‡” LOC ‘–‡”ƒŵ…‘””‡Žƒ–‹‘Şƒ’’”‘š‹ƒ–‹‘ LOC ƒ‡……ŵ•–”‡ƒŞ–”‡‡ŞŽ‡ƒ”‹‰ LOC Žƒ‰‡”•’‡–œŵ‹‡‡”‹‡•’ƒ” LOC 7RWDO LOC )LJ (YDOXDWLQJ WKH LPSDFW DQG RYHUKHDG RI VSRUHV RQ UHDO GLVWULEXWHG DSSOLFDWLRQV MINI EMPIRICAL STUDY #2 How widespread are patterns that can be statically enforced by spores?

Slide 58

Slide 58 text

6SRUHV $ 7\SH%DVHG )RXQGDWLRQ IRU &ORVXUHV LQ WKH $JH RI &RQFXUUHQF\ 'LVWULEXWLRQ DYHUDJH /2& DYHUDJH RI FORVXUHV WKDW 3URMHFW SHU FORVXUH FDSWXUHG YDUV GRQ¶W FDSWXUH •ƒ‡‡”ƒ‰ƒ”™ƒŽŵ„Ž‹†„ LOC ˆ”‡‡ƒŞŽƒ„ŵ–Š—†‡” LOC „‹‰†ƒ–ƒ‰‡‘‹…•ŵƒ†ƒ LOC ‘‘›ƒŽƒŵ•’ƒ”ŞŒ‘„•‡”˜‡” LOC ‘–‡”ƒŵ…‘””‡Žƒ–‹‘Şƒ’’”‘š‹ƒ–‹‘ LOC ƒ‡……ŵ•–”‡ƒŞ–”‡‡ŞŽ‡ƒ”‹‰ LOC Žƒ‰‡”•’‡–œŵ‹‡‡”‹‡•’ƒ” LOC 7RWDO LOC )LJ (YDOXDWLQJ WKH LPSDFW DQG RYHUKHDG RI VSRUHV RQ UHDO GLVWULEXWHG DSSOLFDWLRQV MINI EMPIRICAL STUDY #2 How widespread are patterns that can be statically enforced by spores? 67.2% of all closures can be automatically converted. The remaining 32.8% capture only 1.39 variables on average. ! Thus, unchecked patterns are widespread in real applications, and require only little overhead to enable spore guarantees.

Slide 59

Slide 59 text

THANK YOU.