Slide 1

Slide 1 text

Scala in Practice A pragmatic view on programming language adoption Lutz Huehnken - Solutions Architect, Typesafe, Inc. @lutzhuehnken

Slide 2

Slide 2 text

I.Should a Pragmatist Care About languages? II.The Case For Scala III.Scala in The Real World IV.Scala Adoption Done Right

Slide 3

Slide 3 text

I.Should a Pragmatist Care About languages? II.The Case For Scala III.Scala in The Real World IV.Scala Adoption Done Right

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

Jazoon - Scala in Practice 5 Telling The Computer What To Do.. A programming language is for telling the computer what to do Any Turing-complete language can do that

Slide 6

Slide 6 text

Jazoon - Scala in Practice 6 .. vs. Building A Model Of The World The World is • People and things (objects) interacting which each other? • Described by laws of science and mathematics? • Based on logic?

Slide 7

Slide 7 text

Jazoon - Scala in Practice 7 Ludwig Wittgenstein (1889 - 1951) The limits of my language are the limits of my mind. 
 All I know is what I have words for. Image from Wikipedia

Slide 8

Slide 8 text

Jazoon - Scala in Practice 8 A. Expressiveness OOP Functional Programming Model Logic Programming

Slide 9

Slide 9 text

Jazoon - Scala in Practice 9 B. Productivity Managed Runtime / Garbage Collection > No Garbage Collection Strongly Typed & Static Type-Checking > Weakly Typed or Dynamic Type-Checking

Slide 10

Slide 10 text

Jazoon - Scala in Practice 10 C. Community https://twitter.com/kilaulena/status/463317989648248832

Slide 11

Slide 11 text

Jazoon - Scala in Practice 11 Pragmatic Language Choice Expressiveness Productivity Language Communities

Slide 12

Slide 12 text

I.Should a Pragmatist Care About languages? II.The Case For Scala III.Scala in The Real World IV.Scala Adoption Done Right

Slide 13

Slide 13 text

Jazoon - Scala in Practice 13 Scala unifies OO and FP http://www.scala-lang.org

Slide 14

Slide 14 text

Jazoon - Scala in Practice 14 Scala leverages the JVM Eco System

Slide 15

Slide 15 text

Jazoon - Scala in Practice 15 Scala & Java For All You Know, It's Just a Java Library The customer asks "Where's the Scala part?" I answer "It's in this JAR file." He goes "But, your program is written in Scala, but I looked at the byte-code and it's just Java." I answer "It's Scala... but it compiles down to Java byte-code and it runs in a Java debugger and you can't tell the difference." "You're right," he says. So, to this customer's JVM, the Scala and Lift code looks, smells and tastes just like Java code. If I renamed the scala-library.jar file to apache-closures.jar, nobody would know the difference... at all. http://blog.goodstuff.im/just_another_java_library

Slide 16

Slide 16 text

Jazoon - Scala in Practice 16 Communities: Java Internet Tech in Enterprises Mobile Java Android Java EE Spring

Slide 17

Slide 17 text

Jazoon - Scala in Practice 17 Communities: Python Scientific Computing Data Science Python iPython Notebook NumPy SciPy

Slide 18

Slide 18 text

Jazoon - Scala in Practice 18 Communities: Scala Reactive Systems Big Data Scala Spark Akka ScalaZ Functional Programming Typelevel (shapeless, cats, ..)

Slide 19

Slide 19 text

Jazoon - Scala in Practice 19 The Case For Scala Expressiveness Productivity Scala OO Big Data! Communities Reactive! Java Eco System and Tooling FP

Slide 20

Slide 20 text

I.Should a Pragmatist Care About languages? II.The Case For Scala III.Scala in The Real World IV.Scala Adoption Done Right

Slide 21

Slide 21 text

Jazoon - Scala in Practice

Slide 22

Slide 22 text

Jazoon - Scala in Practice 22 Apache Kafka • Developed at LinkedIn
 • Typical use-case: central publish- subscribe log for integrating data between applications, stream processing, data ingestion (Spark, Hadoop)

Slide 23

Slide 23 text

Jazoon - Scala in Practice 23 Apache Kafka • 3x Intel Xeon 2.5 GHz processor (6 cores)
 • Three producers, 3x async replication • 2,024,032 records/sec
 • Three Consumers • 2,615,968 records/sec

Slide 24

Slide 24 text

Jazoon - Scala in Practice

Slide 25

Slide 25 text

Jazoon - Scala in Practice 25 It’s just too big right now to not mention it..

Slide 26

Slide 26 text

Jazoon - Scala in Practice

Slide 27

Slide 27 text

Jazoon - Scala in Practice 27 Twitter - may be not the role model for your company • Early adaptor, but highly customized • E.g. Twitter „Futures“ • Twitter-Stack (Finagle etc.) • Build system (Pants) • But • Performance / scaling problem solved • Scala going strong at Twitter for 6 years now • And with some impact - „Server as a Function“

Slide 28

Slide 28 text

Jazoon - Scala in Practice

Slide 29

Slide 29 text

Jazoon - Scala in Practice 29 Soundcloud

Slide 30

Slide 30 text

Jazoon - Scala in Practice 30 Soundcloud - a bit of history It was a phase of high experimentation, and instead of defining which languages or runtimes these teams should use, we had the rule of thumb write it in whatever you feel confident enough putting in production and being on-call for. This led to a Cambrian Explosion of languages, runtimes and skills. We had systems being developed in everything from Perl to Julia, including Haskell, Erlang, and node.js. [..] We have used Finagle for HTTP, Thrift, memcached, Redis, and MySQL. Every request to the SoundCloud platform is very likely hitting at least one of our Finagle-powered microservices, and the performance we have from these is quite amazing.

Slide 31

Slide 31 text

Jazoon - Scala in Practice

Slide 32

Slide 32 text

Jazoon - Scala in Practice 32 Morgan Stanley Rumors • Adoption is language - driven
 • Scala because of • Functional Programming • Flexibility (DSLs, Macros..)

Slide 33

Slide 33 text

Jazoon - Scala in Practice

Slide 34

Slide 34 text

Jazoon - Scala in Practice 34 UniCredit Rumors • Akka & externally driven
 • Very skeptical of Scala • Need for some scalable, real time event processing • SI chose Akka, Scala • Delivered under time & budget • Scala it is

Slide 35

Slide 35 text

Jazoon - Scala in Practice

Slide 36

Slide 36 text

Jazoon - Scala in Practice 36 Galeria Kaufhof • Driven by „epiphany“: We need to be a tech company
 • From standard software to build-your-own • Culture change - pure retailer to tech focus

Slide 37

Slide 37 text

Jazoon - Scala in Practice 37 Galeria Kaufhof JUMP! http://www.inoio.de/blog/2014/09/20/technologie-sprung-bei-galeria-kaufhof/

Slide 38

Slide 38 text

Jazoon - Scala in Practice 38 Galeria Kaufhof

Slide 39

Slide 39 text

Jazoon - Scala in Practice 39 Galeria Kaufhof

Slide 40

Slide 40 text

Jazoon - Scala in Practice

Slide 41

Slide 41 text

Jazoon - Scala in Practice 41 Zalando • Magento -> Java -> Scala • Actually polyglot, autonomous teams • But must be on tech radar • Polyglot is great, but maybe not for everyone

Slide 42

Slide 42 text

Jazoon - Scala in Practice

Slide 43

Slide 43 text

Jazoon - Scala in Practice 43 Renault R-Link • Driven by Akka
 • Build by AtoS

Slide 44

Slide 44 text

I.Should a Pragmatist Care About languages? II.The Case For Scala III.Scala in The Real World IV.Scala Adoption Done Right

Slide 45

Slide 45 text

Jazoon - Scala in Practice 45 Scala Caveats For All You Know, It's Just a Java Library.. .. but it’s not! That may be true at runtime - but certainly not in development. Josh Suereth: This is an important point. Scala is not just a “Java++”. There’s a lot of depth to pull out of the language, and lots you can learn. It doesn’t take a lot to start, but it can be intimidating how much is out there. You need to be prepared for it to take some time to learn things

Slide 46

Slide 46 text

Jazoon - Scala in Practice 46 Scala Caveats sbt But once you get the hang of it.. define your Scala build in Scala. It’s actually a great tool

Slide 47

Slide 47 text

Jazoon - Scala in Practice 47 Scala Caveats Parts of the community But everyone I interacted with in the Scala community was super friendly and helpful. Disclaimer: Maybe Tony Morris is, too - I don’t know him and never met him. These „headlines“ are about all I know about him.

Slide 48

Slide 48 text

Jazoon - Scala in Practice 48 Scala Caveats • There is no „Scala EE“. Yet.
 • But patterns are evolving.


Slide 49

Slide 49 text

Jazoon - Scala in Practice 49 Scala Caveats • The power to split teams
 • Goes hand in hand with „We do, because we can“
 • Comp. Design Patterns

Slide 50

Slide 50 text

Jazoon - Scala in Practice 50 Scala Caveats • We can ≠ we should • Coding guidelines • See Twitter, Kafka, Spark..

Slide 51

Slide 51 text

Jazoon - Scala in Practice 51 So do what? •Introduce Scala! •What is your driver? Focus on that. •Give team time to learn, get trainings •Establish coding guidelines •Address and avoid split proactively •There will be along on the road •But it’s worth it!

Slide 52

Slide 52 text

Thank You Lutz Huehnken - Solutions Architect, Typesafe, Inc. @lutzhuehnken

Slide 53

Slide 53 text

©Typesafe 2015 – All Rights Reserved