SlideShare a Scribd company logo
Scala
The Road Ahead
Martin Odersky
Scala Days 2016, NYC
2015
2015 was on the quiet side
•  Maturing tools: 2.11.x, IDEs, sbt
•  Steady growth
indeed.com jobs google trends
2016
In 2016, things are heating up again
•  The Scala Center
•  Scala 2.12 release
•  Rethinking the Scala libraries
•  New target platforms
•  DOT and dotty
A New Steward for Scala
-  Undertake projects that benefit all of the Scala
community.
-  Industrial support by Lightbend, Goldman Sachs,
Nitro, IBM, 47 Degrees, Verizon.
-  More in Heather Miller’s Keynote tomorrow.
Scala 2.12
Optimized for Java 8
•  Uses Java 8’s lambdas and default methods
•  for shorter code and faster execution speed.

Projected release date: mid 2016.
In case you are still on Java 6/7, Scala 2.11 will be
around for a while.
33 features in release notes
2.12 Data
33 features in release notes
336 PRs closed (40 more to go)
65 committers
177 	Lukas	Rytz	
76		 	Jason	Zaugg	
70	 	Adriaan	Moors	
33	 	A.	P.	Marki	
25	 	Felix	Mulder	
17	 	Simon	Ochsenreither	
14	 	Janek	Bogucki	
14	 	Rex	Kerr	
12	 	Sébastien	Doeraene
And, finally:
•  Programming in Scala

3rd edition is out.
•  Updated for 2.12.
•  Book signing 

Tuesday lunch 

12.20-13.20 at

the Artima booth.
Beyond 2.12
Scala 2.13 will focus on the libraries
Plans to revamp collections
•  Even simpler to use
•  More in line with Spark usage
•  Better lazy collections (views)
Current Status:
•  Strawman proposals under study.
•  Would like to have more of them,
Beyond 2.12
Scala 2.13 will focus on the libraries
Better modularization. We are thinking about a
split:

Scala	core	
	
	 	 	Scala	stdlib	
			
	 	 	 	 	 	 	 	 	 	 	Scala	platform	
	
Your input and help is vital for this!
Scala.js 0.6.9
•  “native” anonymus classes
•  js.TupleN
•  JUnit support
•  Faster code generation
COMING SOO
And then there is the
DOT
We finally have a proven foundation for Scala!
The DOT calculus talks about a minimal language
subset, chosen so that
•  we can make and prove formal statements about it
•  we can encode much of the rest of the language in it.
This concludes an 8 year effort!
It opens the door to do language work with much
better confidence than before.
DOT Terms
•  Translated to Scala notation, the language
covered by DOT is:
Value 	 	v 	= 	(x:	T)	=>	t 	 				Function	
	 	 	 	 	new	{	x:	T	=>	d	} 	Object	
Definition		d 	= 	def	a	=	t	 	 	 	Method definition

	 	 	 	 	type	A	=	T 	 	 	Type
Term 	 	t 	= 	v 	 	 	 	 	 	Value

	 	 	 	 	x 	 	 	 	 	 	Variable

	 	 	 	 	t1(t2)	 	 	 	 	Application

	 	 	 	 	t.a	 	 	 	 	 	Selection

	 	 	 	 	{	val	x	=	t1;	t2	} 	Local definition.
DOT Types
The Types covered by DOT are:
Type 	T	 	=	 	Any	 	 	 	 	 	 	Top type

	 	 	 	Nothing 	 	 	 	 	Bottom type

	 	 	 	x.A	 	 	 	 	 	 	Selection

	 	 	 	(x:	T1)	=>	T2	 	 	 	Function

	 	 	 	{	def	a:	T	}	 	 	 	Method declaration

	 	 	 	{	type	T	>:	T1	<:	T2	} 	Type declaration

	 	 	 	T1	&	T2	 	 	 	 	 	Intersection

	 	 	 	{	x	=>	T	} 	 	 	 	Recursion
Type Soundness
The following property was shown with a
mechanized proof:
If a term t has type T,

and evaluation of t terminates:
the result will be a value v of type T.
Why is this Important?
It gives us a technique to reason about
correctness of other language features.
dotty
dotty is working name for our new Scala compiler.
•  Builds on DOT in its internal data structures.
•  Generics get expressed as type members.
•  Supports an evolution of the Scala programming
language.
•  A first developer preview is around the corner
•  Targeted at contributors and experimenters.
dotty – Technical Data
A bit more than half the size of the current Scala
compiler, nsc.
•  dotty: 45 KLoc
•  nsc: 75 KLoc
•  About twice the speed of nsc.
•  should improve significantly in the future.
dotty Architecture
dotty Frontend
dotty Transforms
GenBCode
Classfiles
Simplified AST
AST
Scala Sources
nsc
Scala Sources
TASTY Pickled
nsc Transforms
Simplified AST
AST
Evolving The Language
My Goal:
Make Scala “best” programming language 

I know to how make.
There is not agreement on what is “best”, so all we
can really do is try to find a local optimum.
But finding that optimum is what drives me.
Essential Elements
Conceptually we play with:
•  Functions
•  Classes and objects,
•  Strict evaluation.
•  Local type inference
•  Implicits.
Many languages are currently moving in that space
Goals
1.  Deepen the synthesis of functional
programming and modular programming.
2.  Improve the connection of Scala with its
theoretical foundations.
3.  Improve the guarantees of type system.
4.  But stay simple and approachable.
A Whirlwind Tour Of Dotty
Dropped Features
DelayedInit	
Macros
Existential Types
Procedure Syntax
Early Initializers
General Type 

Projection
Dropped Features
DelayedInit	
Macros
Existential Types
Procedure Syntax
Early Initializers
General Type 

Projection
def	run()	{	...	}	
	
Will be rewritten automatically to
	
def	run():	Unit	=	{	...	}
Dropped Features
DelayedInit	
Macros
Existential Types
Procedure Syntax
Early Initializers
General Type 

Projection
class	Foo		
extends	DelayedInit
Dropped Features
DelayedInit	
Macros
Existential Types
Procedure Syntax
Early Initializers
General Type 

Projection
(the reflection 

based kind)
	
def	m(...)	=		
		macro	impl(...)
Dropped Features
DelayedInit	
Macros
Existential Types
Procedure Syntax
Early Initializers
General Type 

Projection
class	C	extends	{	
		val	x	=	e		
}	with	D	
	
Use trait parameters
instead
Dropped Features
DelayedInit	
Macros
Existential Types
Procedure Syntax
Early Initializers
General Type 

Projection
C[U]	forSome	{	type	U	}	
Wildcards C[_]still supported.
Dropped Features
DelayedInit	
Macros
Existential Types
Procedure Syntax
Early Initializers
General Type 

Projection
T	#	X	
- Was shown to be unsound
for general types T.
- Projection C#X	 from class
types C still available.
Implemented New Features
Multiversal Equality
Intersection Types
Union types
Trait parameters
Function arity
adaptation
Named type
parameters
@static methods and fields
non-blocking lazy vals
Implemented New Features
Multiversal Equality
Intersection Types
Union types
Trait parameters
Function arity
adaptation
Named type
parameters
T	&	U	
	
- replaces T	with	U	
- is commutative
@static methods and fields
non-blocking lazy vals
Implemented New Features
Multiversal Equality
Intersection Types
Union types
Trait parameters
Named type
parameters
T	|	U	
	
avoids huge lubs
@static methods and fields
non-blocking lazy vals
Implemented New Features
Multiversal Equality
Intersection Types
Union types
Trait parameters
Function arity
adaptation
Named type
parameters
pairs.map((x,	y)	=>	x	+	y)	


instead of
pairs.map	{	
		case	(x,	y)	=>	x	+	y	
}	
@static methods and fields
non-blocking lazy vals
Implemented New Features
Multiversal Equality
Intersection Types
Union types
Trait parameters
Function arity
adaptation
Named type
parameters
@static methods and fields
non-blocking lazy vals
trait	T(x:	Int)	{	...	}
Implemented New Features
Multiversal Equality
Intersection Types
Union types
Trait parameters
Function arity
adaptation
Named type
parameters
@static methods and fields
non-blocking lazy vals
object	O	{	
		@static	val	x	=	...	
		@static	def	f()	=	...	
}
Implemented New Features
Multiversal Equality
Intersection Types
Union types
Trait parameters
Function arity
adaptation
Named type
parameters
@static methods and fields
non-blocking lazy vals
lazy	val	x	=	...		// thread-local
	
@volatile	
lazy	val	x	-	...		// thread-safe, 

																		// avoids dead-locks
Implemented New Features
Multiversal Equality
Intersection Types
Union types
Trait parameters
Function arity
adaptation
Named type
parameters
@static methods and fields
non-blocking lazy vals
type-safe	==,	!=
Implemented New Features
Multiversal Equality
Intersection Types
Union types
Trait parameters
Function arity
adaptation
Named type
parameters
trait	Map[type	Key,	type	Value]	
	
Map[Key	=	Int]	
allows partial type parameterization:
- specify some types,
- leave others to be inferred
@static methods and fields
non-blocking lazy vals
Implemented New Features
Multiversal Equality
Intersection Types
Union types
Trait parameters
Function arity
adaptation
Named type
parameters
Motivation
•  Better foundations
•  Easier, safer to use
•  More orthogonal
@static methods and fields
non-blocking lazy vals
Trait or Class?

Classes and traits now have largely the same
capabilities.
Rule of thumb:
•  When it's fully defined, make it a class
•  When it's abstract, make it a trait
Abstract classes are retained mainly for Java
interop and for optimization.
Improvements in Detail
•  Type System
•  Strongly influenced by
DOT
•  Better integration of type
refinements
•  Type Inference
•  Subtyping constraint
solver
•  Inference is simpler to
specify
•  Implicit Search
•  Faster search
algorithm.
•  Better behaved for
contravariant types.
•  Value Classes
•  Nested value classes
•  Arrays of value
classes.
Who’s working on all this?
•  So far, mostly team at EPFL, including
•  Dmitry Petrashko @darkdimius	
•  Guillaume Martres @smarter	
•  Vladimir Nikolayev @vladimirnik	
•  Felix Mulder @felixmulder	
•  Scala team at Lightbend helps with infrastructure,
reviews and suggestions.
•  Your contribution would be very much
appreciated!
•  Without it, nothing much will happen.
Advances in Tooling
•  SBT integration
•  Basic integration exists
•  We are working on
incremental compilation.
•  REPL
•  With syntax highlighting!
•  IDEs
•  Jetbrains working on
IntelliJ plugin.
•  Doc generation
•  Dynamic hyperlinks for
cross-linking libraries.
•  Linker
•  A whole-program
analyzer/opimizer
•  Uses TASTY for
serialization
•  Makes specialization
cheaper and more
robust
And the Future?
Planned In Future Releases
scala.meta
Generic Programming
Better records
Implicit
Function Types
null safety
Effect System
Planned In Future Releases
scala.meta
Generic Programming
Better records
Implicit
Function Types
null safety
Effect System
inline	def	m(inline	x:	Int,	y:	Float):	Float	=	
		meta	{	...	}	
	
	-	inline for inlining, meta for meta-programming.
	-	run by an interpreter (no reflection)
	-	meta uses quasi quotes for matching and construction
	-	blackbox and annotation macros
Why the change?
	
	-	Simpler
	-	Fewer implementation dependencies
	-	Safer, since interpretation allows sandboxing
	-	Restrict syntactic freedom, since no whitebox macros.
Planned In Future Releases
scala.meta
Generic Programming
Better records
Implicit
Function Types
null safety
Effect System
type	CtxS	=	implicit	Context	=>	S	
	
def	f(x:	T):	CtxS	=	{		
		...	implicitly[Context]	...		
}	
f(e)		//	Context	argument	is	passed	implicitly	
Why the change?
	
	-	Small as it looks, this is huge
	-	Allows abstraction over implicit parameters
	-	Eliminates boilerplate
Planned In Future Releases
scala.meta
Generic Programming
Better records
Implicit
Function Types
null safety
Effect System
Effects are implicit capabilities
Two function arrows:
	
	A	=>	B	 	(impure)
	A	->	B	 	(pure)
	
Why the change?
	
	-	Effect checking is very much in

demand.
	-	I believe we can do better than

monads to achieve it.

	-	Implicits are a natural fit.
Planned In Future Releases
scala.meta
Generic Programming
Better records
Implicit
Function Types
null safety
Effect System
Model nullable types as a union types
	
	T?		=			T	|	Null	
	
	-	Types don’t have null by default
	-	Values coming from Java get a “?”. E.g. 

System.out:	PrintStream?	
	-	null	dereferencing is an effect.
	-	System.out.println()	is ok in impure code.
	
Why the change?
	
	-	null	poses unsoundness problems.
	-	Null-safety is conceptually easy once you have

union types and effects.
Planned In Future Releases
scala.meta
Generic Programming
Better records
Implicit
Function Types
null safety
Effect System
“Scrap Your Boilerplate”
	
	-	Product-of-sum interpretation of case class hierarchies
	-	Tuples are HLists, but implemented more efficiently
	
	 	(S,	T,	U)	=	(S,	(T,	(U,	Unit)))	
	
	-	Tuple22/Product22/Function22	will be history.
Why the change?
	
	-	Abstract over arity.
	-	Define behavior for ADTs in a generic way
Planned In Future Releases
scala.meta
Generic Programming
Better records
Implicit
Function Types
null safety
Effect System
	
	-	Analogue of tuples, but with labels.
	-	Should integrate with generic programming
	-	Should be implementable by a HashMap instead of by reflection.
Why the change?
	-	Existing structural types are not very useful.
	-	Need something more flexible, and hopefully simpler.
What About Guard Rails?
•  Scala’s premise: Trust devs to do the right thing.
•  But what if they don’t?
•  And can we even agree what the right thing is?
First Advice: Read this
Containment
Problem: Even if our code base uses the principle of least
power, we do not know whether the libraries that we depend
on do the same.
E.g. library X might define an implicit conversion
implicit	def	i2s(x:	Int):	String	
(patterns like this are more common in practice than you’d like
to think)
So instead of least power you get maximal surprise.
A Modest Proposal
For a conversion
implicit	def	c(x:	A):	B	
make it a style error if the conversion
-  is not defined in one of the packages containing A or B.
-  is itself public (visible outside its package).
When using a library defining such conversions, warn
on the client side as well.
Flexibility: Blessing or Curse?
Scala has great syntactic flexibility.
Sometimes this can be a burden.
Example: Should I write
xs.map(f) 	 or xs	map	f						?
What about
xs.map(f).filter(p) vs xs	map	f	filter	p	
x.min(y) 	 vs x	min	y	 	?
Another Modest Proposal
•  Add an annotation @infix	that indicates that an
operator is supposed to be used infix.
@infix	def	min(y:	Int):	Int
•  Make it a style error if an operator is used in the 

wrong mode.
x	min	y	 	// ok
xs	map	f 	// warning: Infix usage of normal method map
Symbolic Operators
•  If the operator is symbolic, require in addition an
alphanumeric alias:
@infix(“append”)	def	+=	(elem:	T)
•  Make it a style error if the alias is missing
à One knows how to pronounce the operator
à It’s easier to search for it, e.g. 

“Scala append operator” as a search term.
•  To be worked out: What are the precise rules for style
errors?
Thank You

More Related Content

What's hot

Scalax
ScalaxScalax
Scala Days San Francisco
Scala Days San FranciscoScala Days San Francisco
Scala Days San Francisco
Martin Odersky
 
Spark real world use cases and optimizations
Spark real world use cases and optimizationsSpark real world use cases and optimizations
Spark real world use cases and optimizations
Gal Marder
 
Scala - The Simple Parts, SFScala presentation
Scala - The Simple Parts, SFScala presentationScala - The Simple Parts, SFScala presentation
Scala - The Simple Parts, SFScala presentation
Martin Odersky
 
JVM languages "flame wars"
JVM languages "flame wars"JVM languages "flame wars"
JVM languages "flame wars"
Gal Marder
 
The Evolution of Scala / Scala進化論
The Evolution of Scala / Scala進化論The Evolution of Scala / Scala進化論
The Evolution of Scala / Scala進化論
scalaconfjp
 
Weaving Dataflows with Silk - ScalaMatsuri 2014, Tokyo
Weaving Dataflows with Silk - ScalaMatsuri 2014, TokyoWeaving Dataflows with Silk - ScalaMatsuri 2014, Tokyo
Weaving Dataflows with Silk - ScalaMatsuri 2014, Tokyo
Taro L. Saito
 
Dive into spark2
Dive into spark2Dive into spark2
Dive into spark2
Gal Marder
 
The Why and How of Scala at Twitter
The Why and How of Scala at TwitterThe Why and How of Scala at Twitter
The Why and How of Scala at Twitter
Alex Payne
 
Quick introduction to scala
Quick introduction to scalaQuick introduction to scala
Quick introduction to scala
Mohammad Hossein Rimaz
 
flatMap Oslo presentation slides
flatMap Oslo presentation slidesflatMap Oslo presentation slides
flatMap Oslo presentation slides
Martin Odersky
 
Why Scala Is Taking Over the Big Data World
Why Scala Is Taking Over the Big Data WorldWhy Scala Is Taking Over the Big Data World
Why Scala Is Taking Over the Big Data World
Dean Wampler
 
Scarab: SAT-based Constraint Programming System in Scala / Scala上で実現された制約プログラ...
Scarab: SAT-based Constraint Programming System in Scala / Scala上で実現された制約プログラ...Scarab: SAT-based Constraint Programming System in Scala / Scala上で実現された制約プログラ...
Scarab: SAT-based Constraint Programming System in Scala / Scala上で実現された制約プログラ...
scalaconfjp
 
The Evolution of Scala
The Evolution of ScalaThe Evolution of Scala
The Evolution of Scala
Martin Odersky
 
Stream processing from single node to a cluster
Stream processing from single node to a clusterStream processing from single node to a cluster
Stream processing from single node to a cluster
Gal Marder
 
What To Leave Implicit
What To Leave ImplicitWhat To Leave Implicit
What To Leave Implicit
Martin Odersky
 
Preparing for Scala 3
Preparing for Scala 3Preparing for Scala 3
Preparing for Scala 3
Martin Odersky
 
Introduction to Scala Macros
Introduction to Scala MacrosIntroduction to Scala Macros
Introduction to Scala Macros
Knoldus Inc.
 
Introduction to Spark SQL and Catalyst / Spark SQLおよびCalalystの紹介
Introduction to Spark SQL and Catalyst / Spark SQLおよびCalalystの紹介Introduction to Spark SQL and Catalyst / Spark SQLおよびCalalystの紹介
Introduction to Spark SQL and Catalyst / Spark SQLおよびCalalystの紹介
scalaconfjp
 
Scala profiling
Scala profilingScala profiling
Scala profiling
Filippo Pacifici
 

What's hot (20)

Scalax
ScalaxScalax
Scalax
 
Scala Days San Francisco
Scala Days San FranciscoScala Days San Francisco
Scala Days San Francisco
 
Spark real world use cases and optimizations
Spark real world use cases and optimizationsSpark real world use cases and optimizations
Spark real world use cases and optimizations
 
Scala - The Simple Parts, SFScala presentation
Scala - The Simple Parts, SFScala presentationScala - The Simple Parts, SFScala presentation
Scala - The Simple Parts, SFScala presentation
 
JVM languages "flame wars"
JVM languages "flame wars"JVM languages "flame wars"
JVM languages "flame wars"
 
The Evolution of Scala / Scala進化論
The Evolution of Scala / Scala進化論The Evolution of Scala / Scala進化論
The Evolution of Scala / Scala進化論
 
Weaving Dataflows with Silk - ScalaMatsuri 2014, Tokyo
Weaving Dataflows with Silk - ScalaMatsuri 2014, TokyoWeaving Dataflows with Silk - ScalaMatsuri 2014, Tokyo
Weaving Dataflows with Silk - ScalaMatsuri 2014, Tokyo
 
Dive into spark2
Dive into spark2Dive into spark2
Dive into spark2
 
The Why and How of Scala at Twitter
The Why and How of Scala at TwitterThe Why and How of Scala at Twitter
The Why and How of Scala at Twitter
 
Quick introduction to scala
Quick introduction to scalaQuick introduction to scala
Quick introduction to scala
 
flatMap Oslo presentation slides
flatMap Oslo presentation slidesflatMap Oslo presentation slides
flatMap Oslo presentation slides
 
Why Scala Is Taking Over the Big Data World
Why Scala Is Taking Over the Big Data WorldWhy Scala Is Taking Over the Big Data World
Why Scala Is Taking Over the Big Data World
 
Scarab: SAT-based Constraint Programming System in Scala / Scala上で実現された制約プログラ...
Scarab: SAT-based Constraint Programming System in Scala / Scala上で実現された制約プログラ...Scarab: SAT-based Constraint Programming System in Scala / Scala上で実現された制約プログラ...
Scarab: SAT-based Constraint Programming System in Scala / Scala上で実現された制約プログラ...
 
The Evolution of Scala
The Evolution of ScalaThe Evolution of Scala
The Evolution of Scala
 
Stream processing from single node to a cluster
Stream processing from single node to a clusterStream processing from single node to a cluster
Stream processing from single node to a cluster
 
What To Leave Implicit
What To Leave ImplicitWhat To Leave Implicit
What To Leave Implicit
 
Preparing for Scala 3
Preparing for Scala 3Preparing for Scala 3
Preparing for Scala 3
 
Introduction to Scala Macros
Introduction to Scala MacrosIntroduction to Scala Macros
Introduction to Scala Macros
 
Introduction to Spark SQL and Catalyst / Spark SQLおよびCalalystの紹介
Introduction to Spark SQL and Catalyst / Spark SQLおよびCalalystの紹介Introduction to Spark SQL and Catalyst / Spark SQLおよびCalalystの紹介
Introduction to Spark SQL and Catalyst / Spark SQLおよびCalalystの紹介
 
Scala profiling
Scala profilingScala profiling
Scala profiling
 

Viewers also liked

Project Jigsaw in JDK 9: Modularity Comes To Java
Project Jigsaw in JDK 9: Modularity Comes To JavaProject Jigsaw in JDK 9: Modularity Comes To Java
Project Jigsaw in JDK 9: Modularity Comes To Java
C4Media
 
In Search of Segmentation
In Search of SegmentationIn Search of Segmentation
In Search of Segmentation
Adrian Cockcroft
 
Java 9: The (G1) GC Awakens!
Java 9: The (G1) GC Awakens!Java 9: The (G1) GC Awakens!
Java 9: The (G1) GC Awakens!
Monica Beckwith
 
10 SQL Tricks that You Didn't Think Were Possible
10 SQL Tricks that You Didn't Think Were Possible10 SQL Tricks that You Didn't Think Were Possible
10 SQL Tricks that You Didn't Think Were Possible
Lukas Eder
 
Java SE 8 best practices
Java SE 8 best practicesJava SE 8 best practices
Java SE 8 best practices
Stephen Colebourne
 
Microservices + Oracle: A Bright Future
Microservices + Oracle: A Bright FutureMicroservices + Oracle: A Bright Future
Microservices + Oracle: A Bright Future
Kelly Goetsch
 
Slick eventsourcing
Slick eventsourcingSlick eventsourcing
Slick eventsourcing
Adam Warski
 
Lightbend Lagom: Microservices Just Right
Lightbend Lagom: Microservices Just RightLightbend Lagom: Microservices Just Right
Lightbend Lagom: Microservices Just Right
mircodotta
 
Compilers Are Databases
Compilers Are DatabasesCompilers Are Databases
Compilers Are Databases
Martin Odersky
 
From DOT to Dotty
From DOT to DottyFrom DOT to Dotty
From DOT to Dotty
Martin Odersky
 
Why The Free Monad isn't Free
Why The Free Monad isn't FreeWhy The Free Monad isn't Free
Why The Free Monad isn't Free
Kelley Robinson
 

Viewers also liked (11)

Project Jigsaw in JDK 9: Modularity Comes To Java
Project Jigsaw in JDK 9: Modularity Comes To JavaProject Jigsaw in JDK 9: Modularity Comes To Java
Project Jigsaw in JDK 9: Modularity Comes To Java
 
In Search of Segmentation
In Search of SegmentationIn Search of Segmentation
In Search of Segmentation
 
Java 9: The (G1) GC Awakens!
Java 9: The (G1) GC Awakens!Java 9: The (G1) GC Awakens!
Java 9: The (G1) GC Awakens!
 
10 SQL Tricks that You Didn't Think Were Possible
10 SQL Tricks that You Didn't Think Were Possible10 SQL Tricks that You Didn't Think Were Possible
10 SQL Tricks that You Didn't Think Were Possible
 
Java SE 8 best practices
Java SE 8 best practicesJava SE 8 best practices
Java SE 8 best practices
 
Microservices + Oracle: A Bright Future
Microservices + Oracle: A Bright FutureMicroservices + Oracle: A Bright Future
Microservices + Oracle: A Bright Future
 
Slick eventsourcing
Slick eventsourcingSlick eventsourcing
Slick eventsourcing
 
Lightbend Lagom: Microservices Just Right
Lightbend Lagom: Microservices Just RightLightbend Lagom: Microservices Just Right
Lightbend Lagom: Microservices Just Right
 
Compilers Are Databases
Compilers Are DatabasesCompilers Are Databases
Compilers Are Databases
 
From DOT to Dotty
From DOT to DottyFrom DOT to Dotty
From DOT to Dotty
 
Why The Free Monad isn't Free
Why The Free Monad isn't FreeWhy The Free Monad isn't Free
Why The Free Monad isn't Free
 

Similar to Scala Days NYC 2016

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
Spark Summit
 
A full Machine learning pipeline in Scikit-learn vs in scala-Spark: pros and ...
A full Machine learning pipeline in Scikit-learn vs in scala-Spark: pros and ...A full Machine learning pipeline in Scikit-learn vs in scala-Spark: pros and ...
A full Machine learning pipeline in Scikit-learn vs in scala-Spark: pros and ...
Jose Quesada (hiring)
 
An Introduction to Scala - Blending OO and Functional Paradigms
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 Sabin
 
AngularConf2015
AngularConf2015AngularConf2015
AngularConf2015
Alessandro Giorgetti
 
The advantage of developing with TypeScript
The advantage of developing with TypeScript The advantage of developing with TypeScript
The advantage of developing with TypeScript
Corley S.r.l.
 
Scala-Ls1
Scala-Ls1Scala-Ls1
Scala-Ls1
Aniket Joshi
 
Linq To The Enterprise
Linq To The EnterpriseLinq To The Enterprise
Linq To The Enterprise
Daniel Egan
 
Rootcon X - Reverse Engineering Swift Applications
Rootcon X - Reverse Engineering Swift ApplicationsRootcon X - Reverse Engineering Swift Applications
Rootcon X - Reverse Engineering Swift Applications
eightbit
 
Scala, Play 2.0 & Cloud Foundry
Scala, Play 2.0 & Cloud FoundryScala, Play 2.0 & Cloud Foundry
Scala, Play 2.0 & Cloud Foundry
Pray Desai
 
TypeScript . the JavaScript developer best friend!
TypeScript . the JavaScript developer best friend!TypeScript . the JavaScript developer best friend!
TypeScript . the JavaScript developer best friend!
Alessandro Giorgetti
 
Object Oriented Programming with COBOL
Object Oriented Programming with COBOLObject Oriented Programming with COBOL
Object Oriented Programming with COBOL
Micro Focus
 
Java-Intro.pptx
Java-Intro.pptxJava-Intro.pptx
Java-Intro.pptx
VijalJain3
 
DSL's with Groovy
DSL's with GroovyDSL's with Groovy
DSL's with Groovy
paulbowler
 
scalaliftoff2009.pdf
scalaliftoff2009.pdfscalaliftoff2009.pdf
scalaliftoff2009.pdf
Hiroshi Ono
 
scalaliftoff2009.pdf
scalaliftoff2009.pdfscalaliftoff2009.pdf
scalaliftoff2009.pdf
Hiroshi Ono
 
scalaliftoff2009.pdf
scalaliftoff2009.pdfscalaliftoff2009.pdf
scalaliftoff2009.pdf
Hiroshi Ono
 
scalaliftoff2009.pdf
scalaliftoff2009.pdfscalaliftoff2009.pdf
scalaliftoff2009.pdf
Hiroshi Ono
 
Developer’s viewpoint on swift programming language
Developer’s viewpoint on swift programming languageDeveloper’s viewpoint on swift programming language
Developer’s viewpoint on swift programming language
Azilen Technologies Pvt. Ltd.
 
Linq 1224887336792847 9
Linq 1224887336792847 9Linq 1224887336792847 9
Linq 1224887336792847 9
google
 
Scala Talk at FOSDEM 2009
Scala Talk at FOSDEM 2009Scala Talk at FOSDEM 2009
Scala Talk at FOSDEM 2009
Martin Odersky
 

Similar to Scala Days NYC 2016 (20)

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
 
A full Machine learning pipeline in Scikit-learn vs in scala-Spark: pros and ...
A full Machine learning pipeline in Scikit-learn vs in scala-Spark: pros and ...A full Machine learning pipeline in Scikit-learn vs in scala-Spark: pros and ...
A full Machine learning pipeline in Scikit-learn vs in scala-Spark: pros and ...
 
An Introduction to Scala - Blending OO and Functional Paradigms
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
 
AngularConf2015
AngularConf2015AngularConf2015
AngularConf2015
 
The advantage of developing with TypeScript
The advantage of developing with TypeScript The advantage of developing with TypeScript
The advantage of developing with TypeScript
 
Scala-Ls1
Scala-Ls1Scala-Ls1
Scala-Ls1
 
Linq To The Enterprise
Linq To The EnterpriseLinq To The Enterprise
Linq To The Enterprise
 
Rootcon X - Reverse Engineering Swift Applications
Rootcon X - Reverse Engineering Swift ApplicationsRootcon X - Reverse Engineering Swift Applications
Rootcon X - Reverse Engineering Swift Applications
 
Scala, Play 2.0 & Cloud Foundry
Scala, Play 2.0 & Cloud FoundryScala, Play 2.0 & Cloud Foundry
Scala, Play 2.0 & Cloud Foundry
 
TypeScript . the JavaScript developer best friend!
TypeScript . the JavaScript developer best friend!TypeScript . the JavaScript developer best friend!
TypeScript . the JavaScript developer best friend!
 
Object Oriented Programming with COBOL
Object Oriented Programming with COBOLObject Oriented Programming with COBOL
Object Oriented Programming with COBOL
 
Java-Intro.pptx
Java-Intro.pptxJava-Intro.pptx
Java-Intro.pptx
 
DSL's with Groovy
DSL's with GroovyDSL's with Groovy
DSL's with Groovy
 
scalaliftoff2009.pdf
scalaliftoff2009.pdfscalaliftoff2009.pdf
scalaliftoff2009.pdf
 
scalaliftoff2009.pdf
scalaliftoff2009.pdfscalaliftoff2009.pdf
scalaliftoff2009.pdf
 
scalaliftoff2009.pdf
scalaliftoff2009.pdfscalaliftoff2009.pdf
scalaliftoff2009.pdf
 
scalaliftoff2009.pdf
scalaliftoff2009.pdfscalaliftoff2009.pdf
scalaliftoff2009.pdf
 
Developer’s viewpoint on swift programming language
Developer’s viewpoint on swift programming languageDeveloper’s viewpoint on swift programming language
Developer’s viewpoint on swift programming language
 
Linq 1224887336792847 9
Linq 1224887336792847 9Linq 1224887336792847 9
Linq 1224887336792847 9
 
Scala Talk at FOSDEM 2009
Scala Talk at FOSDEM 2009Scala Talk at FOSDEM 2009
Scala Talk at FOSDEM 2009
 

More from Martin Odersky

scalar.pdf
scalar.pdfscalar.pdf
scalar.pdf
Martin Odersky
 
Capabilities for Resources and Effects
Capabilities for Resources and EffectsCapabilities for Resources and Effects
Capabilities for Resources and Effects
Martin Odersky
 
Simplicitly
SimplicitlySimplicitly
Simplicitly
Martin Odersky
 
What To Leave Implicit
What To Leave ImplicitWhat To Leave Implicit
What To Leave Implicit
Martin Odersky
 
Implementing Higher-Kinded Types in Dotty
Implementing Higher-Kinded Types in DottyImplementing Higher-Kinded Types in Dotty
Implementing Higher-Kinded Types in Dotty
Martin Odersky
 
Flatmap
FlatmapFlatmap
Devoxx
DevoxxDevoxx
Oscon keynote: Working hard to keep it simple
Oscon keynote: Working hard to keep it simpleOscon keynote: Working hard to keep it simple
Oscon keynote: Working hard to keep it simple
Martin Odersky
 
Scala eXchange opening
Scala eXchange openingScala eXchange opening
Scala eXchange opening
Martin Odersky
 

More from Martin Odersky (9)

scalar.pdf
scalar.pdfscalar.pdf
scalar.pdf
 
Capabilities for Resources and Effects
Capabilities for Resources and EffectsCapabilities for Resources and Effects
Capabilities for Resources and Effects
 
Simplicitly
SimplicitlySimplicitly
Simplicitly
 
What To Leave Implicit
What To Leave ImplicitWhat To Leave Implicit
What To Leave Implicit
 
Implementing Higher-Kinded Types in Dotty
Implementing Higher-Kinded Types in DottyImplementing Higher-Kinded Types in Dotty
Implementing Higher-Kinded Types in Dotty
 
Flatmap
FlatmapFlatmap
Flatmap
 
Devoxx
DevoxxDevoxx
Devoxx
 
Oscon keynote: Working hard to keep it simple
Oscon keynote: Working hard to keep it simpleOscon keynote: Working hard to keep it simple
Oscon keynote: Working hard to keep it simple
 
Scala eXchange opening
Scala eXchange openingScala eXchange opening
Scala eXchange opening
 

Recently uploaded

Streamlining End-to-End Testing Automation
Streamlining End-to-End Testing AutomationStreamlining End-to-End Testing Automation
Streamlining End-to-End Testing Automation
Anand Bagmar
 
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdfBaha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
Baha Majid
 
Stork Product Overview: An AI-Powered Autonomous Delivery Fleet
Stork Product Overview: An AI-Powered Autonomous Delivery FleetStork Product Overview: An AI-Powered Autonomous Delivery Fleet
Stork Product Overview: An AI-Powered Autonomous Delivery Fleet
Vince Scalabrino
 
WMF 2024 - Unlocking the Future of Data Powering Next-Gen AI with Vector Data...
WMF 2024 - Unlocking the Future of Data Powering Next-Gen AI with Vector Data...WMF 2024 - Unlocking the Future of Data Powering Next-Gen AI with Vector Data...
WMF 2024 - Unlocking the Future of Data Powering Next-Gen AI with Vector Data...
Luigi Fugaro
 
Cost-Effective Strategies For iOS App Development
Cost-Effective Strategies For iOS App DevelopmentCost-Effective Strategies For iOS App Development
Cost-Effective Strategies For iOS App Development
Softradix Technologies
 
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
Paul Brebner
 
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
safelyiotech
 
Building API data products on top of your real-time data infrastructure
Building API data products on top of your real-time data infrastructureBuilding API data products on top of your real-time data infrastructure
Building API data products on top of your real-time data infrastructure
confluent
 
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
Bert Jan Schrijver
 
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
dakas1
 
🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻
🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻
🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻
campbellclarkson
 
Microsoft-Power-Platform-Adoption-Planning.pptx
Microsoft-Power-Platform-Adoption-Planning.pptxMicrosoft-Power-Platform-Adoption-Planning.pptx
Microsoft-Power-Platform-Adoption-Planning.pptx
jrodriguezq3110
 
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
gapen1
 
Penify - Let AI do the Documentation, you write the Code.
Penify - Let AI do the Documentation, you write the Code.Penify - Let AI do the Documentation, you write the Code.
Penify - Let AI do the Documentation, you write the Code.
KrishnaveniMohan1
 
The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024
Yara Milbes
 
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
kgyxske
 
All you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVMAll you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVM
Alina Yurenko
 
Assure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyesAssure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
Transforming Product Development using OnePlan To Boost Efficiency and Innova...
Transforming Product Development using OnePlan To Boost Efficiency and Innova...Transforming Product Development using OnePlan To Boost Efficiency and Innova...
Transforming Product Development using OnePlan To Boost Efficiency and Innova...
OnePlan Solutions
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
Drona Infotech
 

Recently uploaded (20)

Streamlining End-to-End Testing Automation
Streamlining End-to-End Testing AutomationStreamlining End-to-End Testing Automation
Streamlining End-to-End Testing Automation
 
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdfBaha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
 
Stork Product Overview: An AI-Powered Autonomous Delivery Fleet
Stork Product Overview: An AI-Powered Autonomous Delivery FleetStork Product Overview: An AI-Powered Autonomous Delivery Fleet
Stork Product Overview: An AI-Powered Autonomous Delivery Fleet
 
WMF 2024 - Unlocking the Future of Data Powering Next-Gen AI with Vector Data...
WMF 2024 - Unlocking the Future of Data Powering Next-Gen AI with Vector Data...WMF 2024 - Unlocking the Future of Data Powering Next-Gen AI with Vector Data...
WMF 2024 - Unlocking the Future of Data Powering Next-Gen AI with Vector Data...
 
Cost-Effective Strategies For iOS App Development
Cost-Effective Strategies For iOS App DevelopmentCost-Effective Strategies For iOS App Development
Cost-Effective Strategies For iOS App Development
 
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
 
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
 
Building API data products on top of your real-time data infrastructure
Building API data products on top of your real-time data infrastructureBuilding API data products on top of your real-time data infrastructure
Building API data products on top of your real-time data infrastructure
 
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
 
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
 
🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻
🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻
🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻
 
Microsoft-Power-Platform-Adoption-Planning.pptx
Microsoft-Power-Platform-Adoption-Planning.pptxMicrosoft-Power-Platform-Adoption-Planning.pptx
Microsoft-Power-Platform-Adoption-Planning.pptx
 
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
 
Penify - Let AI do the Documentation, you write the Code.
Penify - Let AI do the Documentation, you write the Code.Penify - Let AI do the Documentation, you write the Code.
Penify - Let AI do the Documentation, you write the Code.
 
The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024
 
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
 
All you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVMAll you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVM
 
Assure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyesAssure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyes
 
Transforming Product Development using OnePlan To Boost Efficiency and Innova...
Transforming Product Development using OnePlan To Boost Efficiency and Innova...Transforming Product Development using OnePlan To Boost Efficiency and Innova...
Transforming Product Development using OnePlan To Boost Efficiency and Innova...
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
 

Scala Days NYC 2016

  • 1. Scala The Road Ahead Martin Odersky Scala Days 2016, NYC
  • 3. 2015 was on the quiet side •  Maturing tools: 2.11.x, IDEs, sbt •  Steady growth indeed.com jobs google trends
  • 5. In 2016, things are heating up again •  The Scala Center •  Scala 2.12 release •  Rethinking the Scala libraries •  New target platforms •  DOT and dotty
  • 6. A New Steward for Scala -  Undertake projects that benefit all of the Scala community. -  Industrial support by Lightbend, Goldman Sachs, Nitro, IBM, 47 Degrees, Verizon. -  More in Heather Miller’s Keynote tomorrow.
  • 7. Scala 2.12 Optimized for Java 8 •  Uses Java 8’s lambdas and default methods •  for shorter code and faster execution speed.
 Projected release date: mid 2016. In case you are still on Java 6/7, Scala 2.11 will be around for a while.
  • 8. 33 features in release notes
  • 9. 2.12 Data 33 features in release notes 336 PRs closed (40 more to go) 65 committers 177 Lukas Rytz 76 Jason Zaugg 70 Adriaan Moors 33 A. P. Marki 25 Felix Mulder 17 Simon Ochsenreither 14 Janek Bogucki 14 Rex Kerr 12 Sébastien Doeraene
  • 10. And, finally: •  Programming in Scala
 3rd edition is out. •  Updated for 2.12. •  Book signing 
 Tuesday lunch 
 12.20-13.20 at
 the Artima booth.
  • 11. Beyond 2.12 Scala 2.13 will focus on the libraries Plans to revamp collections •  Even simpler to use •  More in line with Spark usage •  Better lazy collections (views) Current Status: •  Strawman proposals under study. •  Would like to have more of them,
  • 12. Beyond 2.12 Scala 2.13 will focus on the libraries Better modularization. We are thinking about a split:
 Scala core Scala stdlib Scala platform Your input and help is vital for this!
  • 13. Scala.js 0.6.9 •  “native” anonymus classes •  js.TupleN •  JUnit support •  Faster code generation
  • 15. And then there is the
  • 16. DOT We finally have a proven foundation for Scala! The DOT calculus talks about a minimal language subset, chosen so that •  we can make and prove formal statements about it •  we can encode much of the rest of the language in it. This concludes an 8 year effort! It opens the door to do language work with much better confidence than before.
  • 17. DOT Terms •  Translated to Scala notation, the language covered by DOT is: Value v = (x: T) => t Function new { x: T => d } Object Definition d = def a = t Method definition
 type A = T Type Term t = v Value
 x Variable
 t1(t2) Application
 t.a Selection
 { val x = t1; t2 } Local definition.
  • 18. DOT Types The Types covered by DOT are: Type T = Any Top type
 Nothing Bottom type
 x.A Selection
 (x: T1) => T2 Function
 { def a: T } Method declaration
 { type T >: T1 <: T2 } Type declaration
 T1 & T2 Intersection
 { x => T } Recursion
  • 19. Type Soundness The following property was shown with a mechanized proof: If a term t has type T,
 and evaluation of t terminates: the result will be a value v of type T. Why is this Important? It gives us a technique to reason about correctness of other language features.
  • 20. dotty dotty is working name for our new Scala compiler. •  Builds on DOT in its internal data structures. •  Generics get expressed as type members. •  Supports an evolution of the Scala programming language. •  A first developer preview is around the corner •  Targeted at contributors and experimenters.
  • 21. dotty – Technical Data A bit more than half the size of the current Scala compiler, nsc. •  dotty: 45 KLoc •  nsc: 75 KLoc •  About twice the speed of nsc. •  should improve significantly in the future.
  • 22. dotty Architecture dotty Frontend dotty Transforms GenBCode Classfiles Simplified AST AST Scala Sources nsc Scala Sources TASTY Pickled nsc Transforms Simplified AST AST
  • 23. Evolving The Language My Goal: Make Scala “best” programming language 
 I know to how make. There is not agreement on what is “best”, so all we can really do is try to find a local optimum. But finding that optimum is what drives me.
  • 24. Essential Elements Conceptually we play with: •  Functions •  Classes and objects, •  Strict evaluation. •  Local type inference •  Implicits. Many languages are currently moving in that space
  • 25. Goals 1.  Deepen the synthesis of functional programming and modular programming. 2.  Improve the connection of Scala with its theoretical foundations. 3.  Improve the guarantees of type system. 4.  But stay simple and approachable.
  • 26. A Whirlwind Tour Of Dotty
  • 27. Dropped Features DelayedInit Macros Existential Types Procedure Syntax Early Initializers General Type 
 Projection
  • 28. Dropped Features DelayedInit Macros Existential Types Procedure Syntax Early Initializers General Type 
 Projection def run() { ... } Will be rewritten automatically to def run(): Unit = { ... }
  • 29. Dropped Features DelayedInit Macros Existential Types Procedure Syntax Early Initializers General Type 
 Projection class Foo extends DelayedInit
  • 30. Dropped Features DelayedInit Macros Existential Types Procedure Syntax Early Initializers General Type 
 Projection (the reflection 
 based kind) def m(...) = macro impl(...)
  • 31. Dropped Features DelayedInit Macros Existential Types Procedure Syntax Early Initializers General Type 
 Projection class C extends { val x = e } with D Use trait parameters instead
  • 32. Dropped Features DelayedInit Macros Existential Types Procedure Syntax Early Initializers General Type 
 Projection C[U] forSome { type U } Wildcards C[_]still supported.
  • 33. Dropped Features DelayedInit Macros Existential Types Procedure Syntax Early Initializers General Type 
 Projection T # X - Was shown to be unsound for general types T. - Projection C#X from class types C still available.
  • 34. Implemented New Features Multiversal Equality Intersection Types Union types Trait parameters Function arity adaptation Named type parameters @static methods and fields non-blocking lazy vals
  • 35. Implemented New Features Multiversal Equality Intersection Types Union types Trait parameters Function arity adaptation Named type parameters T & U - replaces T with U - is commutative @static methods and fields non-blocking lazy vals
  • 36. Implemented New Features Multiversal Equality Intersection Types Union types Trait parameters Named type parameters T | U avoids huge lubs @static methods and fields non-blocking lazy vals
  • 37. Implemented New Features Multiversal Equality Intersection Types Union types Trait parameters Function arity adaptation Named type parameters pairs.map((x, y) => x + y) 
 instead of pairs.map { case (x, y) => x + y } @static methods and fields non-blocking lazy vals
  • 38. Implemented New Features Multiversal Equality Intersection Types Union types Trait parameters Function arity adaptation Named type parameters @static methods and fields non-blocking lazy vals trait T(x: Int) { ... }
  • 39. Implemented New Features Multiversal Equality Intersection Types Union types Trait parameters Function arity adaptation Named type parameters @static methods and fields non-blocking lazy vals object O { @static val x = ... @static def f() = ... }
  • 40. Implemented New Features Multiversal Equality Intersection Types Union types Trait parameters Function arity adaptation Named type parameters @static methods and fields non-blocking lazy vals lazy val x = ... // thread-local @volatile lazy val x - ... // thread-safe, 
 // avoids dead-locks
  • 41. Implemented New Features Multiversal Equality Intersection Types Union types Trait parameters Function arity adaptation Named type parameters @static methods and fields non-blocking lazy vals type-safe ==, !=
  • 42. Implemented New Features Multiversal Equality Intersection Types Union types Trait parameters Function arity adaptation Named type parameters trait Map[type Key, type Value] Map[Key = Int] allows partial type parameterization: - specify some types, - leave others to be inferred @static methods and fields non-blocking lazy vals
  • 43. Implemented New Features Multiversal Equality Intersection Types Union types Trait parameters Function arity adaptation Named type parameters Motivation •  Better foundations •  Easier, safer to use •  More orthogonal @static methods and fields non-blocking lazy vals
  • 44. Trait or Class?
 Classes and traits now have largely the same capabilities. Rule of thumb: •  When it's fully defined, make it a class •  When it's abstract, make it a trait Abstract classes are retained mainly for Java interop and for optimization.
  • 45. Improvements in Detail •  Type System •  Strongly influenced by DOT •  Better integration of type refinements •  Type Inference •  Subtyping constraint solver •  Inference is simpler to specify •  Implicit Search •  Faster search algorithm. •  Better behaved for contravariant types. •  Value Classes •  Nested value classes •  Arrays of value classes.
  • 46. Who’s working on all this? •  So far, mostly team at EPFL, including •  Dmitry Petrashko @darkdimius •  Guillaume Martres @smarter •  Vladimir Nikolayev @vladimirnik •  Felix Mulder @felixmulder •  Scala team at Lightbend helps with infrastructure, reviews and suggestions. •  Your contribution would be very much appreciated! •  Without it, nothing much will happen.
  • 47. Advances in Tooling •  SBT integration •  Basic integration exists •  We are working on incremental compilation. •  REPL •  With syntax highlighting! •  IDEs •  Jetbrains working on IntelliJ plugin. •  Doc generation •  Dynamic hyperlinks for cross-linking libraries. •  Linker •  A whole-program analyzer/opimizer •  Uses TASTY for serialization •  Makes specialization cheaper and more robust
  • 49. Planned In Future Releases scala.meta Generic Programming Better records Implicit Function Types null safety Effect System
  • 50. Planned In Future Releases scala.meta Generic Programming Better records Implicit Function Types null safety Effect System inline def m(inline x: Int, y: Float): Float = meta { ... } - inline for inlining, meta for meta-programming. - run by an interpreter (no reflection) - meta uses quasi quotes for matching and construction - blackbox and annotation macros Why the change? - Simpler - Fewer implementation dependencies - Safer, since interpretation allows sandboxing - Restrict syntactic freedom, since no whitebox macros.
  • 51. Planned In Future Releases scala.meta Generic Programming Better records Implicit Function Types null safety Effect System type CtxS = implicit Context => S def f(x: T): CtxS = { ... implicitly[Context] ... } f(e) // Context argument is passed implicitly Why the change? - Small as it looks, this is huge - Allows abstraction over implicit parameters - Eliminates boilerplate
  • 52. Planned In Future Releases scala.meta Generic Programming Better records Implicit Function Types null safety Effect System Effects are implicit capabilities Two function arrows: A => B (impure) A -> B (pure) Why the change? - Effect checking is very much in
 demand. - I believe we can do better than
 monads to achieve it.
 - Implicits are a natural fit.
  • 53. Planned In Future Releases scala.meta Generic Programming Better records Implicit Function Types null safety Effect System Model nullable types as a union types T? = T | Null - Types don’t have null by default - Values coming from Java get a “?”. E.g. 
 System.out: PrintStream? - null dereferencing is an effect. - System.out.println() is ok in impure code. Why the change? - null poses unsoundness problems. - Null-safety is conceptually easy once you have
 union types and effects.
  • 54. Planned In Future Releases scala.meta Generic Programming Better records Implicit Function Types null safety Effect System “Scrap Your Boilerplate” - Product-of-sum interpretation of case class hierarchies - Tuples are HLists, but implemented more efficiently (S, T, U) = (S, (T, (U, Unit))) - Tuple22/Product22/Function22 will be history. Why the change? - Abstract over arity. - Define behavior for ADTs in a generic way
  • 55. Planned In Future Releases scala.meta Generic Programming Better records Implicit Function Types null safety Effect System - Analogue of tuples, but with labels. - Should integrate with generic programming - Should be implementable by a HashMap instead of by reflection. Why the change? - Existing structural types are not very useful. - Need something more flexible, and hopefully simpler.
  • 56. What About Guard Rails? •  Scala’s premise: Trust devs to do the right thing. •  But what if they don’t? •  And can we even agree what the right thing is?
  • 58. Containment Problem: Even if our code base uses the principle of least power, we do not know whether the libraries that we depend on do the same. E.g. library X might define an implicit conversion implicit def i2s(x: Int): String (patterns like this are more common in practice than you’d like to think) So instead of least power you get maximal surprise.
  • 59. A Modest Proposal For a conversion implicit def c(x: A): B make it a style error if the conversion -  is not defined in one of the packages containing A or B. -  is itself public (visible outside its package). When using a library defining such conversions, warn on the client side as well.
  • 60. Flexibility: Blessing or Curse? Scala has great syntactic flexibility. Sometimes this can be a burden. Example: Should I write xs.map(f) or xs map f ? What about xs.map(f).filter(p) vs xs map f filter p x.min(y) vs x min y ?
  • 61. Another Modest Proposal •  Add an annotation @infix that indicates that an operator is supposed to be used infix. @infix def min(y: Int): Int •  Make it a style error if an operator is used in the 
 wrong mode. x min y // ok xs map f // warning: Infix usage of normal method map
  • 62. Symbolic Operators •  If the operator is symbolic, require in addition an alphanumeric alias: @infix(“append”) def += (elem: T) •  Make it a style error if the alias is missing à One knows how to pronounce the operator à It’s easier to search for it, e.g. 
 “Scala append operator” as a search term. •  To be worked out: What are the precise rules for style errors?