Scala Talk at FOSDEM 2009

M
Martin OderskyCreator of Scala
A Scalable Language Martin Odersky FOSDEM 2009
The software landscape today … ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
This is both good and bad ,[object Object],[object Object],[object Object],[object Object],[object Object]
Alternative: Scalable languages ,[object Object],[object Object],[object Object],[object Object]
Scala is a scripting language ,[object Object],[object Object],[object Object],scala>  var capital = Map("US"    "Washington", "France"    "Paris") capital: Map[String, String] = Map(US    Washington, France    Paris) scala>  capital += ("Japan"    "Tokio") scala>  capital("France") res7: String = Paris
Scala is the Java of the future ,[object Object],[object Object],[object Object],[object Object],object   App  {    def   main ( args :  Array [ String ]) {    if  ( args   exists  (_. toLowerCase   ==   "-help" ))    printUsage ()   else     process ( args )   } }
Interoperability ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Scala is a composition language ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],trait  Analyzer {  this : Backend =>   … } trait   Backend   extends   Analyzer   with   Optimization   with   Generation  { val   global :  Main     import   global ._ type   OutputMedium  <:  Writable   }
Is Scala a “kitchen-sink language”? ,[object Object],[object Object],[object Object],[object Object],[object Object]
Scala compared to Java Modeled   in libraries:   assert, enums, properties, events, actors, using, queries, … ,[object Object],+ abstract types Scala removes Scala adds - wildcards + existential types ,[object Object],+ pattern matching - special treatment of interfaces + mixin composition with traits - break, continue + closures  - primitive types + operator overloading - static members + a pure object system
Scala cheat sheet (1): Definitions ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Scala cheat sheet (2): Expressions ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Scala cheat sheet (3): Objects and Classes ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Scala cheat sheet (4): Traits ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Spring Cleaning ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],var   capital  =  Map ( &quot;US&quot;   ->   &quot;Washington&quot; ,  &quot;Canada&quot;   ->   &quot;ottawa&quot; ) capital  += ( &quot;Japan&quot;  ->  &quot;Tokyo&quot; ) for  (c <- capital.keys) capital(c) = capital(c).capitalize assert(capital( &quot;Canada&quot; ) ==  &quot;Ottawa&quot; )
… with one major difference ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Scalability demands extensibility ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Adding new datatypes - seamlessly ,[object Object],def   factorial ( x :  BigInt ):  BigInt  =    if  ( x   ==  0) 1  else   x   *   factorial ( x   -  1) Compare with using Java's class: import  java.math.BigInteger def   factorial ( x :  BigInteger ):  BigInteger  =   if  ( x   ==  BigInteger.ZERO)   BigInteger . ONE   else   x . multiply (factorial(x.subtract(BigInteger.ONE))) }
Implementing new datatypes - seamlessly ,[object Object],import  java.math.BigInteger class   BigInt ( val   bigInteger :  BigInteger )  extends   java . lang . Number  { def   +  ( that :  BigInt ) =    new   BigInt ( this . bigInteger   add   that . bigInteger ) def   -  ( that :  BigInt ) =    new   BigInt ( this . bigInteger   subtract   that . bigInteger ) …  // other methods implemented analogously } +  is an identifier; can be used as a method name Infix operations are method calls: a + b   is the same as  a.+(b) a add b   is the same as  a.add(b)
Adding new control structures  ,[object Object],[object Object],using  ( new   BufferedReader ( new   FileReader ( path ))) {   f  =>  println ( f . readLine ()) } val   f  =  new   BufferedReader ( new   FileReader ( path )) try  {   println ( f . readLine ()) }  finally  {   if  ( f   !=   null )  f . close () }
Implementing new control structures: ,[object Object],def   using [ T  <: {  def   close () }]   ( resource :  T )   ( block :  T  =>  Unit ) {   try  {   block ( resource )   }  finally  {   if  ( resource   !=   null )  resource . close ()   } } T  is a type parameter... … supporting a  close   method A closure that takes a  T   parameter
Break and continue ,[object Object],[object Object],[object Object],[object Object],[object Object],import  scala.util.control.Breaks._ breakable {   for  (x <- elems) {   println(x * 2)   if (x > 0) break   } }
Getting back break and continue
What makes Scala scalable? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Scala is object-oriented ,[object Object],[object Object],[object Object],scala>  (1).hashCode res8: Int = 1 scala>  (1).+(2) res10: Int = 3
Scala is functional ,[object Object],[object Object],[object Object],scala>  val matrix = Array(Array(1, 0, 0),     |  Array(0, 1, 0),    |  Array(0, 0, 1)) matrix: Array[Array[Int]] = Array([I@164da25,…  scala>  matrix.exists(row => row.forall(0 ==)) res13: Boolean = false
Functions  are  objects ,[object Object],[object Object],[object Object],[object Object],[object Object],trait   Function1 [ -S ,  +T ] {   def   apply ( x :  S ):  T } new   Function1 [ Int ,  Int ] {   def   apply ( x :  Int ) =    x   +  1 }
Why should I care? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Partial functions ,[object Object],[object Object],[object Object],[object Object],[object Object],trait   PartialFunction [- A , + B ] extends  ( A  =>  B ) { def   isDefinedAt ( x :  A ): Boolean }
Developing new paradigms ,[object Object],[object Object],[object Object],[object Object]
Erlang-style actors ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],A pattern matching block of type PartialFunction[ MessageType ,  ActionType ]
A simple actor case   class   Data ( bytes :  Array [ Byte ]) case   class   Sum ( receiver :  Actor ) val   checkSumCalculator  =  actor  { var  sum = 0 loop  { receive  { case   Data ( bs ) =>  sum   +=   hash ( bs ) case   Sum ( receiver ) =>  receiver   !   sum } } } } repeatedly  receive  messages Spawn a new actor
Implementing receive ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Other Approaches to Scalability ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Where are we now? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
The Scala community ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Tool support ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Tool support ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Who’s using it? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Learning Scala ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Thank You To try it out: scala-lang.org Thanks also to the (past and present) members of the Scala team: Philippe Altherr, Vincent Cremet, Iulian Dragos, Gilles Dubochet, Burak Emir, Sebastian Hack, Philipp Haller, Sean McDirmid, Ingo Meier, Adriaan Moors, Stéphane Micheloud, Nikolay Mihaylov, Anders Nielssen, Tiark Rompf, Lukas Rytz, Michel Schinz, Lex Spoon, Erik Stenman, Geoffrey Alan Washburn, Matthias Zenger .
Relationship between Scala and other languages ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
1 of 42

Recommended

The New JavaScript: ES6 by
The New JavaScript: ES6The New JavaScript: ES6
The New JavaScript: ES6Rob Eisenberg
4K views23 slides
Introduction to Scala by
Introduction to ScalaIntroduction to Scala
Introduction to ScalaMohammad Hossein Rimaz
5.8K views83 slides
Java 8 Lambda and Streams by
Java 8 Lambda and StreamsJava 8 Lambda and Streams
Java 8 Lambda and StreamsVenkata Naga Ravi
3.9K views51 slides
Data Types & Variables in JAVA by
Data Types & Variables in JAVAData Types & Variables in JAVA
Data Types & Variables in JAVAAnkita Totala
2.2K views21 slides
Modern JS with ES6 by
Modern JS with ES6Modern JS with ES6
Modern JS with ES6Kevin Langley Jr.
6.5K views200 slides
Java Presentation by
Java PresentationJava Presentation
Java Presentationpm2214
17.4K views28 slides

More Related Content

What's hot

ES6 presentation by
ES6 presentationES6 presentation
ES6 presentationritika1
565 views18 slides
The Functional Programming Triad of Map, Filter and Fold by
The Functional Programming Triad of Map, Filter and FoldThe Functional Programming Triad of Map, Filter and Fold
The Functional Programming Triad of Map, Filter and FoldPhilip Schwarz
3.5K views51 slides
Sum and Product Types - The Fruit Salad & Fruit Snack Example - From F# to Ha... by
Sum and Product Types -The Fruit Salad & Fruit Snack Example - From F# to Ha...Sum and Product Types -The Fruit Salad & Fruit Snack Example - From F# to Ha...
Sum and Product Types - The Fruit Salad & Fruit Snack Example - From F# to Ha...Philip Schwarz
827 views20 slides
C by balaguruswami - e.balagurusamy by
C   by balaguruswami - e.balagurusamyC   by balaguruswami - e.balagurusamy
C by balaguruswami - e.balagurusamySrichandan Sobhanayak
16.7K views150 slides
An Introduction to Programming in Java: Arrays by
An Introduction to Programming in Java: ArraysAn Introduction to Programming in Java: Arrays
An Introduction to Programming in Java: ArraysMartin Chapman
1.4K views59 slides
Files in c++ ppt by
Files in c++ pptFiles in c++ ppt
Files in c++ pptKumar
11.5K views106 slides

What's hot(20)

ES6 presentation by ritika1
ES6 presentationES6 presentation
ES6 presentation
ritika1565 views
The Functional Programming Triad of Map, Filter and Fold by Philip Schwarz
The Functional Programming Triad of Map, Filter and FoldThe Functional Programming Triad of Map, Filter and Fold
The Functional Programming Triad of Map, Filter and Fold
Philip Schwarz3.5K views
Sum and Product Types - The Fruit Salad & Fruit Snack Example - From F# to Ha... by Philip Schwarz
Sum and Product Types -The Fruit Salad & Fruit Snack Example - From F# to Ha...Sum and Product Types -The Fruit Salad & Fruit Snack Example - From F# to Ha...
Sum and Product Types - The Fruit Salad & Fruit Snack Example - From F# to Ha...
Philip Schwarz827 views
An Introduction to Programming in Java: Arrays by Martin Chapman
An Introduction to Programming in Java: ArraysAn Introduction to Programming in Java: Arrays
An Introduction to Programming in Java: Arrays
Martin Chapman1.4K views
Files in c++ ppt by Kumar
Files in c++ pptFiles in c++ ppt
Files in c++ ppt
Kumar 11.5K views
Core java concepts by Ram132
Core java  conceptsCore java  concepts
Core java concepts
Ram13235.8K views
Javascript arrays by Hassan Dar
Javascript arraysJavascript arrays
Javascript arrays
Hassan Dar6.5K views
Collection Framework in java by CPD INDIA
Collection Framework in javaCollection Framework in java
Collection Framework in java
CPD INDIA8.5K views
Scala 3 by Example - Algebraic Data Types for Domain Driven Design - Part 1 by Philip Schwarz
Scala 3 by Example - Algebraic Data Types for Domain Driven Design - Part 1Scala 3 by Example - Algebraic Data Types for Domain Driven Design - Part 1
Scala 3 by Example - Algebraic Data Types for Domain Driven Design - Part 1
Philip Schwarz1.9K views
Fundamental JavaScript [UTC, March 2014] by Aaron Gustafson
Fundamental JavaScript [UTC, March 2014]Fundamental JavaScript [UTC, March 2014]
Fundamental JavaScript [UTC, March 2014]
Aaron Gustafson8.5K views

Similar to Scala Talk at FOSDEM 2009

scalaliftoff2009.pdf by
scalaliftoff2009.pdfscalaliftoff2009.pdf
scalaliftoff2009.pdfHiroshi Ono
746 views37 slides
scalaliftoff2009.pdf by
scalaliftoff2009.pdfscalaliftoff2009.pdf
scalaliftoff2009.pdfHiroshi Ono
1.4K views37 slides
scalaliftoff2009.pdf by
scalaliftoff2009.pdfscalaliftoff2009.pdf
scalaliftoff2009.pdfHiroshi Ono
472 views37 slides
scalaliftoff2009.pdf by
scalaliftoff2009.pdfscalaliftoff2009.pdf
scalaliftoff2009.pdfHiroshi Ono
463 views37 slides
Getting Started With Scala by
Getting Started With ScalaGetting Started With Scala
Getting Started With ScalaMeetu Maltiar
1.3K views35 slides
Getting Started With Scala by
Getting Started With ScalaGetting Started With Scala
Getting Started With ScalaXebia IT Architects
2K views35 slides

Similar to Scala Talk at FOSDEM 2009(20)

scalaliftoff2009.pdf by Hiroshi Ono
scalaliftoff2009.pdfscalaliftoff2009.pdf
scalaliftoff2009.pdf
Hiroshi Ono746 views
scalaliftoff2009.pdf by Hiroshi Ono
scalaliftoff2009.pdfscalaliftoff2009.pdf
scalaliftoff2009.pdf
Hiroshi Ono1.4K views
scalaliftoff2009.pdf by Hiroshi Ono
scalaliftoff2009.pdfscalaliftoff2009.pdf
scalaliftoff2009.pdf
Hiroshi Ono472 views
scalaliftoff2009.pdf by Hiroshi Ono
scalaliftoff2009.pdfscalaliftoff2009.pdf
scalaliftoff2009.pdf
Hiroshi Ono463 views
Getting Started With Scala by Meetu Maltiar
Getting Started With ScalaGetting Started With Scala
Getting Started With Scala
Meetu Maltiar1.3K views
The Scala Programming Language by league
The Scala Programming LanguageThe Scala Programming Language
The Scala Programming Language
league1.4K views
Qcon2011 functions rockpresentation_scala by Michael Stal
Qcon2011 functions rockpresentation_scalaQcon2011 functions rockpresentation_scala
Qcon2011 functions rockpresentation_scala
Michael Stal872 views
Short intro to scala and the play framework by Felipe
Short intro to scala and the play frameworkShort intro to scala and the play framework
Short intro to scala and the play framework
Felipe 1.7K views
whats new in java 8 by Dori Waldman
whats new in java 8 whats new in java 8
whats new in java 8
Dori Waldman535 views
An Introduction to Scala - Blending OO and Functional Paradigms by Miles Sabin
An Introduction to Scala - Blending OO and Functional ParadigmsAn Introduction to Scala - Blending OO and Functional Paradigms
An Introduction to Scala - Blending OO and Functional Paradigms
Miles Sabin767 views
BCS SPA 2010 - An Introduction to Scala for Java Developers by Miles Sabin
BCS SPA 2010 - An Introduction to Scala for Java DevelopersBCS SPA 2010 - An Introduction to Scala for Java Developers
BCS SPA 2010 - An Introduction to Scala for Java Developers
Miles Sabin682 views
An Introduction to Scala for Java Developers by Miles Sabin
An Introduction to Scala for Java DevelopersAn Introduction to Scala for Java Developers
An Introduction to Scala for Java Developers
Miles Sabin1.5K views
About Functional Programming by Aapo Kyrölä
About Functional ProgrammingAbout Functional Programming
About Functional Programming
Aapo Kyrölä1.1K views
Miles Sabin Introduction To Scala For Java Developers by Skills Matter
Miles Sabin Introduction To Scala For Java DevelopersMiles Sabin Introduction To Scala For Java Developers
Miles Sabin Introduction To Scala For Java Developers
Skills Matter1.4K views
A Brief Introduction to Scala for Java Developers by Miles Sabin
A Brief Introduction to Scala for Java DevelopersA Brief Introduction to Scala for Java Developers
A Brief Introduction to Scala for Java Developers
Miles Sabin5.2K views
Scala overview by Steve Min
Scala overviewScala overview
Scala overview
Steve Min3.7K views

More from Martin Odersky

scalar.pdf by
scalar.pdfscalar.pdf
scalar.pdfMartin Odersky
961 views44 slides
Capabilities for Resources and Effects by
Capabilities for Resources and EffectsCapabilities for Resources and Effects
Capabilities for Resources and EffectsMartin Odersky
5.5K views29 slides
Preparing for Scala 3 by
Preparing for Scala 3Preparing for Scala 3
Preparing for Scala 3Martin Odersky
11.1K views48 slides
Simplicitly by
SimplicitlySimplicitly
SimplicitlyMartin Odersky
2.1K views33 slides
What To Leave Implicit by
What To Leave ImplicitWhat To Leave Implicit
What To Leave ImplicitMartin Odersky
3.7K views41 slides
What To Leave Implicit by
What To Leave ImplicitWhat To Leave Implicit
What To Leave ImplicitMartin Odersky
6.1K views67 slides

More from Martin Odersky(19)

Capabilities for Resources and Effects by Martin Odersky
Capabilities for Resources and EffectsCapabilities for Resources and Effects
Capabilities for Resources and Effects
Martin Odersky5.5K views
Implementing Higher-Kinded Types in Dotty by Martin Odersky
Implementing Higher-Kinded Types in DottyImplementing Higher-Kinded Types in Dotty
Implementing Higher-Kinded Types in Dotty
Martin Odersky11.9K views
Compilers Are Databases by Martin Odersky
Compilers Are DatabasesCompilers Are Databases
Compilers Are Databases
Martin Odersky13.9K views
Scala Days San Francisco by Martin Odersky
Scala Days San FranciscoScala Days San Francisco
Scala Days San Francisco
Martin Odersky65.9K views
The Evolution of Scala by Martin Odersky
The Evolution of ScalaThe Evolution of Scala
The Evolution of Scala
Martin Odersky44.4K views
Scala - The Simple Parts, SFScala presentation by Martin Odersky
Scala - The Simple Parts, SFScala presentationScala - The Simple Parts, SFScala presentation
Scala - The Simple Parts, SFScala presentation
Martin Odersky16.5K views
flatMap Oslo presentation slides by Martin Odersky
flatMap Oslo presentation slidesflatMap Oslo presentation slides
flatMap Oslo presentation slides
Martin Odersky24.9K views
Oscon keynote: Working hard to keep it simple by Martin Odersky
Oscon keynote: Working hard to keep it simpleOscon keynote: Working hard to keep it simple
Oscon keynote: Working hard to keep it simple
Martin Odersky33.5K views

Recently uploaded

Pharmaceutical Inorganic Chemistry Unit IVMiscellaneous compounds Expectorant... by
Pharmaceutical Inorganic Chemistry Unit IVMiscellaneous compounds Expectorant...Pharmaceutical Inorganic Chemistry Unit IVMiscellaneous compounds Expectorant...
Pharmaceutical Inorganic Chemistry Unit IVMiscellaneous compounds Expectorant...Ms. Pooja Bhandare
166 views45 slides
11.28.23 Social Capital and Social Exclusion.pptx by
11.28.23 Social Capital and Social Exclusion.pptx11.28.23 Social Capital and Social Exclusion.pptx
11.28.23 Social Capital and Social Exclusion.pptxmary850239
383 views25 slides
GCSE Geography by
GCSE GeographyGCSE Geography
GCSE GeographyWestHatch
47 views32 slides
The basics - information, data, technology and systems.pdf by
The basics - information, data, technology and systems.pdfThe basics - information, data, technology and systems.pdf
The basics - information, data, technology and systems.pdfJonathanCovena1
156 views1 slide
AUDIENCE - BANDURA.pptx by
AUDIENCE - BANDURA.pptxAUDIENCE - BANDURA.pptx
AUDIENCE - BANDURA.pptxiammrhaywood
131 views44 slides
CONTENTS.pptx by
CONTENTS.pptxCONTENTS.pptx
CONTENTS.pptxiguerendiain
65 views17 slides

Recently uploaded(20)

Pharmaceutical Inorganic Chemistry Unit IVMiscellaneous compounds Expectorant... by Ms. Pooja Bhandare
Pharmaceutical Inorganic Chemistry Unit IVMiscellaneous compounds Expectorant...Pharmaceutical Inorganic Chemistry Unit IVMiscellaneous compounds Expectorant...
Pharmaceutical Inorganic Chemistry Unit IVMiscellaneous compounds Expectorant...
Ms. Pooja Bhandare166 views
11.28.23 Social Capital and Social Exclusion.pptx by mary850239
11.28.23 Social Capital and Social Exclusion.pptx11.28.23 Social Capital and Social Exclusion.pptx
11.28.23 Social Capital and Social Exclusion.pptx
mary850239383 views
GCSE Geography by WestHatch
GCSE GeographyGCSE Geography
GCSE Geography
WestHatch47 views
The basics - information, data, technology and systems.pdf by JonathanCovena1
The basics - information, data, technology and systems.pdfThe basics - information, data, technology and systems.pdf
The basics - information, data, technology and systems.pdf
JonathanCovena1156 views
AUDIENCE - BANDURA.pptx by iammrhaywood
AUDIENCE - BANDURA.pptxAUDIENCE - BANDURA.pptx
AUDIENCE - BANDURA.pptx
iammrhaywood131 views
BÀI TẬP BỔ TRỢ TIẾNG ANH FAMILY AND FRIENDS NATIONAL EDITION - LỚP 4 (CÓ FIL... by Nguyen Thanh Tu Collection
BÀI TẬP BỔ TRỢ TIẾNG ANH FAMILY AND FRIENDS NATIONAL EDITION - LỚP 4 (CÓ FIL...BÀI TẬP BỔ TRỢ TIẾNG ANH FAMILY AND FRIENDS NATIONAL EDITION - LỚP 4 (CÓ FIL...
BÀI TẬP BỔ TRỢ TIẾNG ANH FAMILY AND FRIENDS NATIONAL EDITION - LỚP 4 (CÓ FIL...
CUNY IT Picciano.pptx by apicciano
CUNY IT Picciano.pptxCUNY IT Picciano.pptx
CUNY IT Picciano.pptx
apicciano56 views
REPRESENTATION - GAUNTLET.pptx by iammrhaywood
REPRESENTATION - GAUNTLET.pptxREPRESENTATION - GAUNTLET.pptx
REPRESENTATION - GAUNTLET.pptx
iammrhaywood151 views
How to empty an One2many field in Odoo by Celine George
How to empty an One2many field in OdooHow to empty an One2many field in Odoo
How to empty an One2many field in Odoo
Celine George97 views
Retail Store Scavenger Hunt.pptx by jmurphy154
Retail Store Scavenger Hunt.pptxRetail Store Scavenger Hunt.pptx
Retail Store Scavenger Hunt.pptx
jmurphy15447 views
A-Level Art by WestHatch
A-Level ArtA-Level Art
A-Level Art
WestHatch48 views
Create a Structure in VBNet.pptx by Breach_P
Create a Structure in VBNet.pptxCreate a Structure in VBNet.pptx
Create a Structure in VBNet.pptx
Breach_P80 views

Scala Talk at FOSDEM 2009

  • 1. A Scalable Language Martin Odersky FOSDEM 2009
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23. Getting back break and continue
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32. A simple actor case class Data ( bytes : Array [ Byte ]) case class Sum ( receiver : Actor ) val checkSumCalculator = actor { var sum = 0 loop { receive { case Data ( bs ) => sum += hash ( bs ) case Sum ( receiver ) => receiver ! sum } } } } repeatedly receive messages Spawn a new actor
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41. Thank You To try it out: scala-lang.org Thanks also to the (past and present) members of the Scala team: Philippe Altherr, Vincent Cremet, Iulian Dragos, Gilles Dubochet, Burak Emir, Sebastian Hack, Philipp Haller, Sean McDirmid, Ingo Meier, Adriaan Moors, Stéphane Micheloud, Nikolay Mihaylov, Anders Nielssen, Tiark Rompf, Lukas Rytz, Michel Schinz, Lex Spoon, Erik Stenman, Geoffrey Alan Washburn, Matthias Zenger .
  • 42.