SlideShare a Scribd company logo
Monday, 5th July 
Peter Pilgrim, Oracle Java Champion, 

SCALA, WHY NOW?
Brief History Scala

 Scala – Scalable Language
 Pre‐history
   1996 – 1997 Pizza, 1998‐2000 GJ
 2003 Experiment
 2006‐2009 Industrial strength 
 programming language

           “Make a better Java” 
Martin Odersky’s Scala Workshop
Why Scala?
                             • Closures
                             • Lambda Currying
             Functional
                             • Immutables
                             • Style


                                      • Full Types
                           Object     • Hierarchical, Mix‐
                          Oriented      Ins
                                      • Case Classes


                                      • Operators 
                                        Overloading
                          Scalable    • Pattern Matching
                                      • Extendable with 
                                        Libraries

                             • Static compilation 
               Cross           to byte codes
             Platform        • JVM 
                             • Dot Net
Functional Side

 Closures , Lambda Expression, Function 
 Types
 Immutable References to Objects (val)
 Immutable Objects & Collections 
   Standard Scala Libraries
 Currying – Control Abstractions
 Last Statement is an Expression
 Tail Recursion
Object Oriented Side

 Everything is an Object in Scala
 Better Static Classes (Object)
 Classes with reduced boilerplate
 Traits , Mix‐ins, Self‐Types
REPL ‐ Read, Evaluate, Print, Loop


 Execute Scala like a Scripting language
 Increasing support 
   Eclipse IDE , NetBeans, IntelliJ
 New Tools, Ideas and Innovations
   SBT, Actors, Lift
Repeat Until Construction #1a

package demo;

object Control {
  def repeatLoop ( body: => Unit ) =
     new Until( body )

    def class Until( body: => Unit ) {
        def until( cond: => Boolean ) {
          body;
          if ( cond )
              repeatLoop(body).until(cond)
        }
      }
}
Repeat Until Construction #1b

import demo.Control;


object LoopDemo {
    def main( args: Array[String] ) {
        var y=0;
        repeatLoop {
           println("found y="+y)
           y += 1
        }
        {   until ( y < 10 )   }
    }
}
Quick Introduction to Currying

 Haskell Curry (1901 – 1982)
   American Mathematician & Logician
   Combinatory Logic
   Partial Functions


  U(x,y,z) == F(x) ‐> G(y) ‐> H(z)
Repeat Until Construction #2
object Control {
    def repeat(body: => Unit) = new {
      def until(condition: => Boolean) = {
        do {
          body
        } while (!condition)
      }
    }
}


// Jesper and Rex Kerr
Concurrency in Scala

 Actor based concurrency library (Bill Venners)
 Asynchronous messages
 Dispatch to threads; Fork Join
Taste of Concurrency #1
import scala.actors._
import scala.actors.Actor._

object TradeMessageProcessor extends Actor {
  def act() {
    loop {
      receive {
        case f: FXOrder => f.spotPrice()
        case m: MMOrder => m.maturityPrice()
        case “stop” => println(“Stopping now...”; exit
        case x: Any -> println(“Error: unknown msg: “+x)
      }
    }
  }
}
Taste of Concurrency #2
TradeMessageProcessor.start()


TradeMessageProcessor ! new FXForwardOrder ( /*...*/ )
TradeMessageProcessor ! new FXSpotOrder( /*...*/ )
TradeMessageProcessor ! new MMOrder( /*...*/ )


TradeMessageProcessor ! 2.87134 // Unknown Msg Error!


TradeMessageProcessor ! “stop” // Processor stops
Thanks For Your Attention!
For more information
  http://scala‐lang.org
  http://daily‐scala.blogspot.com/
  http://stack‐overflow.com search on Scala
Scala is the Java of the Future




         http://jroller.com/javawug

More Related Content

PPTX
Introduction to Scala language
PDF
Scala profiling
PPTX
Scala in practice
PDF
Java 8 and Beyond, a Scala Story
ODP
Drilling the Async Library
KEY
LSUG: How we (mostly) moved from Java to Scala
KEY
Java to scala
KEY
Java to Scala: Why & How
Introduction to Scala language
Scala profiling
Scala in practice
Java 8 and Beyond, a Scala Story
Drilling the Async Library
LSUG: How we (mostly) moved from Java to Scala
Java to scala
Java to Scala: Why & How

What's hot (20)

ODP
Introduction to Scala JS
PPTX
Scala-Ls1
PDF
Martin Odersky - Evolution of Scala
PDF
What's a macro?: Learning by Examples / Scalaのマクロに実用例から触れてみよう!
PPTX
From Ruby to Scala
PDF
Introduction to Scala : Clueda
PPTX
Introduction to Kotlin Language and its application to Android platform
PPTX
Why I don’t want to develop iOS apps in Objective C
PPTX
AKKA and Scala @ Inneractive
PDF
Scala at foursquare
PDF
Scala in-practice-3-years by Patric Fornasier, Springr, presented at Pune Sca...
PDF
Scala Days NYC 2016
PDF
Why Scala Is Taking Over the Big Data World
PPTX
Speaking Scala: Refactoring for Fun and Profit (Workshop)
KEY
Scala at Mind Candy
PDF
Introduction to Scala | Big Data Hadoop Spark Tutorial | CloudxLab
PPTX
Paws - A Perl AWS SDK
PPTX
An Introduction to Scala
KEY
The Ruby Racer: under the hood
PDF
Scala, Akka, and Play: An Introduction on Heroku
Introduction to Scala JS
Scala-Ls1
Martin Odersky - Evolution of Scala
What's a macro?: Learning by Examples / Scalaのマクロに実用例から触れてみよう!
From Ruby to Scala
Introduction to Scala : Clueda
Introduction to Kotlin Language and its application to Android platform
Why I don’t want to develop iOS apps in Objective C
AKKA and Scala @ Inneractive
Scala at foursquare
Scala in-practice-3-years by Patric Fornasier, Springr, presented at Pune Sca...
Scala Days NYC 2016
Why Scala Is Taking Over the Big Data World
Speaking Scala: Refactoring for Fun and Profit (Workshop)
Scala at Mind Candy
Introduction to Scala | Big Data Hadoop Spark Tutorial | CloudxLab
Paws - A Perl AWS SDK
An Introduction to Scala
The Ruby Racer: under the hood
Scala, Akka, and Play: An Introduction on Heroku
Ad

Similar to Javawug bof 57 scala why now (20)

PPTX
Scala, Play 2.0 & Cloud Foundry
PDF
Google06
PDF
(How) can we benefit from adopting scala?
ODP
Introduction To Scala
PDF
Scala google
PDF
Getting Started With Scala
PDF
Getting Started With Scala
PPTX
Introduction to scala for a c programmer
PDF
An Introduction to Scala - Blending OO and Functional Paradigms
PDF
The Scala Programming Language
PDF
scalaliftoff2009.pdf
PDF
scalaliftoff2009.pdf
PDF
scalaliftoff2009.pdf
PDF
scalaliftoff2009.pdf
PDF
Stepping Up : A Brief Intro to Scala
PDF
Scala: Object-Oriented Meets Functional, by Iulian Dragos
PDF
From Python to Scala
PDF
Scala at GenevaJUG by Iulian Dragos
PPTX
Introduction to Clojure and why it's hot for Sart-Ups
PDF
Miles Sabin Introduction To Scala For Java Developers
Scala, Play 2.0 & Cloud Foundry
Google06
(How) can we benefit from adopting scala?
Introduction To Scala
Scala google
Getting Started With Scala
Getting Started With Scala
Introduction to scala for a c programmer
An Introduction to Scala - Blending OO and Functional Paradigms
The Scala Programming Language
scalaliftoff2009.pdf
scalaliftoff2009.pdf
scalaliftoff2009.pdf
scalaliftoff2009.pdf
Stepping Up : A Brief Intro to Scala
Scala: Object-Oriented Meets Functional, by Iulian Dragos
From Python to Scala
Scala at GenevaJUG by Iulian Dragos
Introduction to Clojure and why it's hot for Sart-Ups
Miles Sabin Introduction To Scala For Java Developers
Ad

More from Skills Matter (20)

PDF
5 things cucumber is bad at by Richard Lawrence
ODP
Patterns for slick database applications
PDF
Scala e xchange 2013 haoyi li on metascala a tiny diy jvm
ODP
Oscar reiken jr on our success at manheim
ODP
Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...
PDF
Cukeup nyc ian dees on elixir, erlang, and cucumberl
PDF
Cukeup nyc peter bell on getting started with cucumber.js
PDF
Agile testing & bdd e xchange nyc 2013 jeffrey davidson & lav pathak & sam ho...
ODP
Progressive f# tutorials nyc rachel reese & phil trelford on try f# from zero...
ODP
Progressive f# tutorials nyc don syme on keynote f# in the open source world
PDF
Agile testing & bdd e xchange nyc 2013 gojko adzic on bond villain guide to s...
PPTX
Dmitry mozorov on code quotations code as-data for f#
PDF
A poet's guide_to_acceptance_testing
PDF
Russ miles-cloudfoundry-deep-dive
KEY
Serendipity-neo4j
PDF
Simon Peyton Jones: Managing parallelism
PDF
Plug 20110217
PDF
Lug presentation
PPT
I went to_a_communications_workshop_and_they_t
PDF
Plug saiku
5 things cucumber is bad at by Richard Lawrence
Patterns for slick database applications
Scala e xchange 2013 haoyi li on metascala a tiny diy jvm
Oscar reiken jr on our success at manheim
Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...
Cukeup nyc ian dees on elixir, erlang, and cucumberl
Cukeup nyc peter bell on getting started with cucumber.js
Agile testing & bdd e xchange nyc 2013 jeffrey davidson & lav pathak & sam ho...
Progressive f# tutorials nyc rachel reese & phil trelford on try f# from zero...
Progressive f# tutorials nyc don syme on keynote f# in the open source world
Agile testing & bdd e xchange nyc 2013 gojko adzic on bond villain guide to s...
Dmitry mozorov on code quotations code as-data for f#
A poet's guide_to_acceptance_testing
Russ miles-cloudfoundry-deep-dive
Serendipity-neo4j
Simon Peyton Jones: Managing parallelism
Plug 20110217
Lug presentation
I went to_a_communications_workshop_and_they_t
Plug saiku

Recently uploaded (20)

PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Empathic Computing: Creating Shared Understanding
PDF
Machine learning based COVID-19 study performance prediction
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
Cloud computing and distributed systems.
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
Approach and Philosophy of On baking technology
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
20250228 LYD VKU AI Blended-Learning.pptx
Agricultural_Statistics_at_a_Glance_2022_0.pdf
NewMind AI Weekly Chronicles - August'25 Week I
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Empathic Computing: Creating Shared Understanding
Machine learning based COVID-19 study performance prediction
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Cloud computing and distributed systems.
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Approach and Philosophy of On baking technology
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
MYSQL Presentation for SQL database connectivity
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Network Security Unit 5.pdf for BCA BBA.
Encapsulation_ Review paper, used for researhc scholars
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
“AI and Expert System Decision Support & Business Intelligence Systems”

Javawug bof 57 scala why now