SlideShare a Scribd company logo
1 of 29
Download to read offline
Scala
PasT, Present &
Future
@mircodotta
Who am I?
• Felt in love with Scala in 2005
• Open Source contributor: Scala
compiler & IDE, Lagom, Play, etc.
• Recently co-founded a Scala tooling
company!
• Available for trainings (Akka/Play/
Scala/Spark) and consulting.
Whoever wishes
to foresee the
future must
consult the past
Macchiavelli
Scala: The Past
• Scala first release in 2003
• But, what’s the story before Scala?
Pizza
• 1995-19981
• Superset of Java with generics, first-
class functions, case classes and
patter matching.
• Why the name?
• Java was hacker’s drink
• Hacker’s food was needed ;-)
1. www.slideshare.net/Odersky/scala-evolution/3-Pre_History1980s_Modula2_Oberon199095_Functional
Java 1.5
• Pizza led to Martin Odersky working
on the Java compiler (javac).
• Martin co-designed the first version
of generics in Java, and has written
the recent javac.
Scala origins
• Goal: unify object-oriented and
functional paradigms.
• Java was too constraining, hence the
motivation to start fresh.
2003
Scala Martin’s mantra
• A language with a small core, few
constructs but high abstraction power.
• Fact: Scala has less keywords than
Java!
Scala evolution
First
release
2003
Twitter
adoption
Scala 2.0
released
2006
Akka
first release
2009
Lightbend
(formerly Typesafe)
commercial
support
Scala 2.9
released
&
Scala project
moved
to GitHub
2011
Scala evolution
2012
Scala 2.10
released
Scala Actor
deprecated
and replaced
by Akka
2013
Scala.JS
released
2014
Scala 2.11
released
2016
Scala 2.12
(currently RC2)
Scala Centre
Foundation
created!
Scala 2.9 to 2.11
• Releases are mainly about stability.
• Only new features:
• Value classes
• Implicit classes
• String interpolation
• macros (experimental)
Scala 2.12
• No additions to the language.
• So… ?
Scala 2.12
• Scala 2.12 requires Java8.
• trait compiled to Java8 interface.
• Binary compat & reduced bytecode!
• scalac λ bytecode mimics javac’s.
• scala.FunctionN compiles to SAM
type (Java8 λ).
• New backend & optimiser1
1. https://dl.dropboxusercontent.com/u/4881107/website/scala-user-group-2016.pdf
New trait encoding
trait PriceAlgorithm[Item] {
def apply(item: Item): Double =
???
}
Let’s compare Scala 2.11 vs 2.12 bytecode
trait PriceAlgorithm[Item] {
def apply(item: Item): Double =
???
}
Compiled with Scala 2.11
interface PriceAlgorithm<Item> {
abstract double apply(Item);
}
abstract class PriceAlgorithm$class {
static double apply(PriceAlgorithm,
java.lang.Object);
static void $init$(PriceAlgorithm);
}
Two
classfiles
trait PriceAlgorithm[Item] {
def apply(item: Item): Double =
???
}
Compiled with Scala 2.12
interface PriceAlgorithm<Item> {
public double apply(Item);
static double apply$(PriceAlgorithm,
java.lang.Object);
static void $init$(PriceAlgorithm);
}
Only one
classfile!
Java8 API from Scala
Scala λ assignable to Java 8 λ
scala> import java.util.stream.{Stream, IntStream}
scala> import java.util.{Arrays, List}
scala> val myList = Arrays.asList("a1", "a2", "b1", "c2", "c1")
myList: java.util.List[String] = [a1, a2, b1, c2, c1]
scala> myList.stream.
filter(_.startsWith("c")).
map(_.toUpperCase).
sorted.
forEach(println)
C1
C2
Why an optimiser?
• Some well-known patterns are not
optimised by HotSpot (Oracle JIT).
• Transform the code to please HotSpot.
• Inlining vs binary resilience.
• Optimiser is not a magic wand, but
rather a tool for experts.
• Compile with the -optimise flag.
Scala future
2016
Scala 2.12 Scala 2.13 (Aida)
Improve the
library!
Smaller core
& stabilise
Q1 2018
(Don Giovanni)
Faster compiler
Improve binary
compatibility (TASTY)
2020?
Dotty?
• Dotty is the new Scala compiler Martin
is working on with his group at EPFL.
• It’s research work, but a first release
should be available soon.
• https://github.com/lampepfl/dotty
• Goal is to simplify the language.
The future of Scala
on a A4 paper
Credit goes to @malweene
https://twitter.com/malweene/status/743117270948274176
Questions?
@mircodotta

More Related Content

What's hot

Javawug bof 57 scala why now
Javawug bof 57 scala why nowJavawug bof 57 scala why now
Javawug bof 57 scala why now
Skills Matter
 
"Walk in a distributed systems park with Orleans" Евгений Бобров
"Walk in a distributed systems park with Orleans" Евгений Бобров"Walk in a distributed systems park with Orleans" Евгений Бобров
"Walk in a distributed systems park with Orleans" Евгений Бобров
Fwdays
 

What's hot (20)

Scala in practice
Scala in practiceScala in practice
Scala in practice
 
Jakarta EE Recipes
Jakarta EE RecipesJakarta EE Recipes
Jakarta EE Recipes
 
とりあえず使うScalaz
とりあえず使うScalazとりあえず使うScalaz
とりあえず使うScalaz
 
Introduction to Akka - Atlanta Java Users Group
Introduction to Akka - Atlanta Java Users GroupIntroduction to Akka - Atlanta Java Users Group
Introduction to Akka - Atlanta Java Users Group
 
Akkurate Akka
Akkurate AkkaAkkurate Akka
Akkurate Akka
 
Lessons Learned: Scala and its Ecosystem
Lessons Learned: Scala and its EcosystemLessons Learned: Scala and its Ecosystem
Lessons Learned: Scala and its Ecosystem
 
Introduction to Actor Model and Akka
Introduction to Actor Model and AkkaIntroduction to Actor Model and Akka
Introduction to Actor Model and Akka
 
What’s expected in Spring 5
What’s expected in Spring 5What’s expected in Spring 5
What’s expected in Spring 5
 
Javawug bof 57 scala why now
Javawug bof 57 scala why nowJavawug bof 57 scala why now
Javawug bof 57 scala why now
 
Scala at Mind Candy
Scala at Mind CandyScala at Mind Candy
Scala at Mind Candy
 
Building APIs with Kotlin and Spark
Building APIs with Kotlin and SparkBuilding APIs with Kotlin and Spark
Building APIs with Kotlin and Spark
 
Scala Introduction - Meetup Scaladores RJ
Scala Introduction - Meetup Scaladores RJScala Introduction - Meetup Scaladores RJ
Scala Introduction - Meetup Scaladores RJ
 
Adi Polak - Light up the Spark in Catalyst by avoiding UDFs - Codemotion Berl...
Adi Polak - Light up the Spark in Catalyst by avoiding UDFs - Codemotion Berl...Adi Polak - Light up the Spark in Catalyst by avoiding UDFs - Codemotion Berl...
Adi Polak - Light up the Spark in Catalyst by avoiding UDFs - Codemotion Berl...
 
Managing Large Numbers of Non trivial ETL pipelines.
Managing Large Numbers of Non trivial ETL pipelines.Managing Large Numbers of Non trivial ETL pipelines.
Managing Large Numbers of Non trivial ETL pipelines.
 
Developing distributed applications with Akka and Akka Cluster
Developing distributed applications with Akka and Akka ClusterDeveloping distributed applications with Akka and Akka Cluster
Developing distributed applications with Akka and Akka Cluster
 
Adi Polak - Light up the Spark in Catalyst by avoiding UDFs - Codemotion Berl...
Adi Polak - Light up the Spark in Catalyst by avoiding UDFs - Codemotion Berl...Adi Polak - Light up the Spark in Catalyst by avoiding UDFs - Codemotion Berl...
Adi Polak - Light up the Spark in Catalyst by avoiding UDFs - Codemotion Berl...
 
Actor model in .NET - Akka.NET
Actor model in .NET - Akka.NETActor model in .NET - Akka.NET
Actor model in .NET - Akka.NET
 
Akka Fundamentals
Akka FundamentalsAkka Fundamentals
Akka Fundamentals
 
"Walk in a distributed systems park with Orleans" Евгений Бобров
"Walk in a distributed systems park with Orleans" Евгений Бобров"Walk in a distributed systems park with Orleans" Евгений Бобров
"Walk in a distributed systems park with Orleans" Евгений Бобров
 
Project Orleans - Actor Model framework
Project Orleans - Actor Model frameworkProject Orleans - Actor Model framework
Project Orleans - Actor Model framework
 

Viewers also liked

Practical Aggregate Programming in Scala
Practical Aggregate Programming in ScalaPractical Aggregate Programming in Scala
Practical Aggregate Programming in Scala
Roberto Casadei
 
Distributed Systems Done Right: Why Java Enterprises Are Embracing The Actor ...
Distributed Systems Done Right: Why Java Enterprises Are Embracing The Actor ...Distributed Systems Done Right: Why Java Enterprises Are Embracing The Actor ...
Distributed Systems Done Right: Why Java Enterprises Are Embracing The Actor ...
Lightbend
 
Effective Scala (SoftShake 2013)
Effective Scala (SoftShake 2013)Effective Scala (SoftShake 2013)
Effective Scala (SoftShake 2013)
mircodotta
 

Viewers also liked (20)

Six years of Scala and counting
Six years of Scala and countingSix years of Scala and counting
Six years of Scala and counting
 
Reactive Access to MongoDB from Scala
Reactive Access to MongoDB from ScalaReactive Access to MongoDB from Scala
Reactive Access to MongoDB from Scala
 
Getting started with MongoDB and Scala - Open Source Bridge 2012
Getting started with MongoDB and Scala - Open Source Bridge 2012Getting started with MongoDB and Scala - Open Source Bridge 2012
Getting started with MongoDB and Scala - Open Source Bridge 2012
 
Semana12 oct31 nov2
Semana12 oct31 nov2Semana12 oct31 nov2
Semana12 oct31 nov2
 
Web without framework
Web without frameworkWeb without framework
Web without framework
 
MongoDB and Play! Framework workshop
MongoDB and Play! Framework workshopMongoDB and Play! Framework workshop
MongoDB and Play! Framework workshop
 
Solid scala
Solid scalaSolid scala
Solid scala
 
Managing Binary Compatibility in Scala (Scala Days 2011)
Managing Binary Compatibility in Scala (Scala Days 2011)Managing Binary Compatibility in Scala (Scala Days 2011)
Managing Binary Compatibility in Scala (Scala Days 2011)
 
Go Reactive: Event-Driven, Scalable, Resilient & Responsive Systems (Soft-Sha...
Go Reactive: Event-Driven, Scalable, Resilient & Responsive Systems (Soft-Sha...Go Reactive: Event-Driven, Scalable, Resilient & Responsive Systems (Soft-Sha...
Go Reactive: Event-Driven, Scalable, Resilient & Responsive Systems (Soft-Sha...
 
Practical Aggregate Programming in Scala
Practical Aggregate Programming in ScalaPractical Aggregate Programming in Scala
Practical Aggregate Programming in Scala
 
Java 8 and beyond, a scala story
Java 8 and beyond, a scala storyJava 8 and beyond, a scala story
Java 8 and beyond, a scala story
 
Scala in Practice
Scala in PracticeScala in Practice
Scala in Practice
 
Enterprise Development Trends 2016 - Cloud, Container and Microservices Insig...
Enterprise Development Trends 2016 - Cloud, Container and Microservices Insig...Enterprise Development Trends 2016 - Cloud, Container and Microservices Insig...
Enterprise Development Trends 2016 - Cloud, Container and Microservices Insig...
 
Akka streams
Akka streamsAkka streams
Akka streams
 
Distributed Systems Done Right: Why Java Enterprises Are Embracing The Actor ...
Distributed Systems Done Right: Why Java Enterprises Are Embracing The Actor ...Distributed Systems Done Right: Why Java Enterprises Are Embracing The Actor ...
Distributed Systems Done Right: Why Java Enterprises Are Embracing The Actor ...
 
Effective Scala (SoftShake 2013)
Effective Scala (SoftShake 2013)Effective Scala (SoftShake 2013)
Effective Scala (SoftShake 2013)
 
Lightbend Lagom: Microservices Just Right (Scala Days 2016 Berlin)
Lightbend Lagom: Microservices Just Right (Scala Days 2016 Berlin)Lightbend Lagom: Microservices Just Right (Scala Days 2016 Berlin)
Lightbend Lagom: Microservices Just Right (Scala Days 2016 Berlin)
 
Benefits Of The Actor Model For Cloud Computing: A Pragmatic Overview For Jav...
Benefits Of The Actor Model For Cloud Computing: A Pragmatic Overview For Jav...Benefits Of The Actor Model For Cloud Computing: A Pragmatic Overview For Jav...
Benefits Of The Actor Model For Cloud Computing: A Pragmatic Overview For Jav...
 
Akka streams scala italy2015
Akka streams scala italy2015Akka streams scala italy2015
Akka streams scala italy2015
 
Microservices in Java and Scala (sfscala)
Microservices in Java and Scala (sfscala)Microservices in Java and Scala (sfscala)
Microservices in Java and Scala (sfscala)
 

Similar to Scala Past, Present & Future

An Introduction to Scala
An Introduction to ScalaAn Introduction to Scala
An Introduction to Scala
Brent Lemons
 
Building Concurrent WebObjects applications with Scala
Building Concurrent WebObjects applications with ScalaBuilding Concurrent WebObjects applications with Scala
Building Concurrent WebObjects applications with Scala
WO Community
 
Scala, Akka, and Play: An Introduction on Heroku
Scala, Akka, and Play: An Introduction on HerokuScala, Akka, and Play: An Introduction on Heroku
Scala, Akka, and Play: An Introduction on Heroku
Havoc Pennington
 
Martin Odersky - Evolution of Scala
Martin Odersky - Evolution of ScalaMartin Odersky - Evolution of Scala
Martin Odersky - Evolution of Scala
Scala Italy
 

Similar to Scala Past, Present & Future (20)

An Introduction to Scala
An Introduction to ScalaAn Introduction to Scala
An Introduction to Scala
 
Building Concurrent WebObjects applications with Scala
Building Concurrent WebObjects applications with ScalaBuilding Concurrent WebObjects applications with Scala
Building Concurrent WebObjects applications with Scala
 
Scala-Ls1
Scala-Ls1Scala-Ls1
Scala-Ls1
 
Martin Odersky: What's next for Scala
Martin Odersky: What's next for ScalaMartin Odersky: What's next for Scala
Martin Odersky: What's next for Scala
 
Introduction to Scala
Introduction to ScalaIntroduction to Scala
Introduction to Scala
 
Scala,a practicle approach
Scala,a practicle approachScala,a practicle approach
Scala,a practicle approach
 
Scala & Spark Online Training
Scala & Spark Online TrainingScala & Spark Online Training
Scala & Spark Online Training
 
Scala Days San Francisco
Scala Days San FranciscoScala Days San Francisco
Scala Days San Francisco
 
Scala final ppt vinay
Scala final ppt vinayScala final ppt vinay
Scala final ppt vinay
 
Scala, Akka, and Play: An Introduction on Heroku
Scala, Akka, and Play: An Introduction on HerokuScala, Akka, and Play: An Introduction on Heroku
Scala, Akka, and Play: An Introduction on Heroku
 
Scala for n00bs by a n00b.
Scala for n00bs by a n00b.Scala for n00bs by a n00b.
Scala for n00bs by a n00b.
 
Introducing Scala to your Ruby/Java Shop : My experiences at IGN
Introducing Scala to your Ruby/Java Shop : My experiences at IGNIntroducing Scala to your Ruby/Java Shop : My experiences at IGN
Introducing Scala to your Ruby/Java Shop : My experiences at IGN
 
Develop realtime web with Scala and Xitrum
Develop realtime web with Scala and XitrumDevelop realtime web with Scala and Xitrum
Develop realtime web with Scala and Xitrum
 
Martin Odersky - Evolution of Scala
Martin Odersky - Evolution of ScalaMartin Odersky - Evolution of Scala
Martin Odersky - Evolution of Scala
 
A Tour Of Scala
A Tour Of ScalaA Tour Of Scala
A Tour Of Scala
 
BOF2644 Developing Java EE 7 Scala apps
BOF2644 Developing Java EE 7 Scala appsBOF2644 Developing Java EE 7 Scala apps
BOF2644 Developing Java EE 7 Scala apps
 
Scala at Treasure Data
Scala at Treasure DataScala at Treasure Data
Scala at Treasure Data
 
Scala, Play 2.0 & Cloud Foundry
Scala, Play 2.0 & Cloud FoundryScala, Play 2.0 & Cloud Foundry
Scala, Play 2.0 & Cloud Foundry
 
Scala adoption by enterprises
Scala adoption by enterprisesScala adoption by enterprises
Scala adoption by enterprises
 
Spark - The Ultimate Scala Collections by Martin Odersky
Spark - The Ultimate Scala Collections by Martin OderskySpark - The Ultimate Scala Collections by Martin Odersky
Spark - The Ultimate Scala Collections by Martin Odersky
 

Recently uploaded

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Recently uploaded (20)

Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 

Scala Past, Present & Future

  • 2. Who am I? • Felt in love with Scala in 2005 • Open Source contributor: Scala compiler & IDE, Lagom, Play, etc. • Recently co-founded a Scala tooling company! • Available for trainings (Akka/Play/ Scala/Spark) and consulting.
  • 3. Whoever wishes to foresee the future must consult the past Macchiavelli
  • 4. Scala: The Past • Scala first release in 2003 • But, what’s the story before Scala?
  • 5.
  • 6. Pizza • 1995-19981 • Superset of Java with generics, first- class functions, case classes and patter matching. • Why the name? • Java was hacker’s drink • Hacker’s food was needed ;-) 1. www.slideshare.net/Odersky/scala-evolution/3-Pre_History1980s_Modula2_Oberon199095_Functional
  • 7.
  • 8. Java 1.5 • Pizza led to Martin Odersky working on the Java compiler (javac). • Martin co-designed the first version of generics in Java, and has written the recent javac.
  • 9. Scala origins • Goal: unify object-oriented and functional paradigms. • Java was too constraining, hence the motivation to start fresh.
  • 10. 2003
  • 11. Scala Martin’s mantra • A language with a small core, few constructs but high abstraction power. • Fact: Scala has less keywords than Java!
  • 12. Scala evolution First release 2003 Twitter adoption Scala 2.0 released 2006 Akka first release 2009 Lightbend (formerly Typesafe) commercial support Scala 2.9 released & Scala project moved to GitHub 2011
  • 13. Scala evolution 2012 Scala 2.10 released Scala Actor deprecated and replaced by Akka 2013 Scala.JS released 2014 Scala 2.11 released 2016 Scala 2.12 (currently RC2) Scala Centre Foundation created!
  • 14. Scala 2.9 to 2.11 • Releases are mainly about stability. • Only new features: • Value classes • Implicit classes • String interpolation • macros (experimental)
  • 15.
  • 16. Scala 2.12 • No additions to the language. • So… ?
  • 17.
  • 18. Scala 2.12 • Scala 2.12 requires Java8. • trait compiled to Java8 interface. • Binary compat & reduced bytecode! • scalac λ bytecode mimics javac’s. • scala.FunctionN compiles to SAM type (Java8 λ). • New backend & optimiser1 1. https://dl.dropboxusercontent.com/u/4881107/website/scala-user-group-2016.pdf
  • 19. New trait encoding trait PriceAlgorithm[Item] { def apply(item: Item): Double = ??? } Let’s compare Scala 2.11 vs 2.12 bytecode
  • 20. trait PriceAlgorithm[Item] { def apply(item: Item): Double = ??? } Compiled with Scala 2.11 interface PriceAlgorithm<Item> { abstract double apply(Item); } abstract class PriceAlgorithm$class { static double apply(PriceAlgorithm, java.lang.Object); static void $init$(PriceAlgorithm); } Two classfiles
  • 21. trait PriceAlgorithm[Item] { def apply(item: Item): Double = ??? } Compiled with Scala 2.12 interface PriceAlgorithm<Item> { public double apply(Item); static double apply$(PriceAlgorithm, java.lang.Object); static void $init$(PriceAlgorithm); } Only one classfile!
  • 22. Java8 API from Scala Scala λ assignable to Java 8 λ scala> import java.util.stream.{Stream, IntStream} scala> import java.util.{Arrays, List} scala> val myList = Arrays.asList("a1", "a2", "b1", "c2", "c1") myList: java.util.List[String] = [a1, a2, b1, c2, c1] scala> myList.stream. filter(_.startsWith("c")). map(_.toUpperCase). sorted. forEach(println) C1 C2
  • 23. Why an optimiser? • Some well-known patterns are not optimised by HotSpot (Oracle JIT). • Transform the code to please HotSpot. • Inlining vs binary resilience. • Optimiser is not a magic wand, but rather a tool for experts. • Compile with the -optimise flag.
  • 24.
  • 25.
  • 26. Scala future 2016 Scala 2.12 Scala 2.13 (Aida) Improve the library! Smaller core & stabilise Q1 2018 (Don Giovanni) Faster compiler Improve binary compatibility (TASTY) 2020?
  • 27. Dotty? • Dotty is the new Scala compiler Martin is working on with his group at EPFL. • It’s research work, but a first release should be available soon. • https://github.com/lampepfl/dotty • Goal is to simplify the language.
  • 28. The future of Scala on a A4 paper Credit goes to @malweene https://twitter.com/malweene/status/743117270948274176