Object-oriented and functional
“A drunken Martin Odersky sees a Reese's Peanut Butter Cup ad featuring somebody's peanut butter getting on somebody else's chocolate and has an idea.
He creates Scala, a language that unifies constructs from both object oriented and functional languages. This pisses off both groups and each promptly declares jihad.” ¹
¹ A Brief, Incomplete, and Mostly Wrong History of Programming Languages
Statically typed with local type inference
Class/trait-based inheritance and subtyping
Joe Armstrong (creator of Erlang):
We'll focus on 2. and 3. today.
Simplest solution which works consistently
(and still takes all known issues into account)?
Works for all types which define
… because readability is not optional!
(deprecated in 2.10)
Octal numeric literal
Octal escape literal
Octal numeric literal (deprecated in 2.10)
Octal escape literal (deprecated in 2.11)
You know you need string interpolation,
when people start using XML literals as a replacement!
Extensible by design
Example: formatting interpolator
<%syntax deprecated in 2.11
Types, members and packages from these
scopes are available without import:
java.lang._ by default:
Current options in Scala:
Future options in Scala:
Native support for unions and intersection types in DOT, the formalization of Scala's next typesystem
Code/Features/Libraries need time to mature!
Example: Scala Macros
Source or binary compatibility? Both?
Requires modification of:
removetakes two arguments
Sounds reasonable, but ...
completely non-deterministic exception handling!