SlideShare a Scribd company logo
1 of 16
Download to read offline
What's new in Scala and the
Scala IDE for Eclipse for 2.8.0




               Miles Sabin, Chuusai Ltd.
               http://www.chuusai.com/
Vastly Improved REPL
●
    Read Eval Print Loop: Interactive interpreter
    ●
        Unusual for a statically typed JVM language
    ●
        New maintainer: Paul Phillips
●
    New for 2.8.0
    ●
        Completion (packages, classes, members)
    ●
        Interactive debugging
New Collection Libraries
●
    Collections in <= 2.7.5
    ●
        Evolved haphazardly
    ●
        Hard work for implementors
    ●
        Code duplication to avoid unnatural types
    ●
        Unpredictable performance
    ●
        Java interoperability incomplete
New Collection Libraries
●
    Collections in 2.8.0
    ●
        Coherent design in terms of traversals and
        builders
    ●
        Builders support natural types
    ●
        Systematic sharing reduces duplication
    ●
        Lazy views now explicit
    ●
        Java interoperability conversion bidirectional
    ●
        Minimal impact on clients
New Collection Libraries


                  Traversable


                    Iterable


   Map                  Set                     Sequence


SortedMap   SortedSet         BitSet   Buffer    Vector    LinearSequence
Package Objects
●
    How to support clients expecting old
    package layout?
●
    Package objects support additional
    members not on any class, trait, object
    package object scala {
        type List[+A] = scala.collection.immutable.List[A]
        val List = scala.collection.immutable.List
        ...
    }

●
    Can be used by any library provider
Break (but not continue)
●
    Scala promotes functional styles — this can
    trip up imperative programmers
      for(e <- l) if(p(e)) f(p) else ??? // How to bail out?

●
    Traditional break behaviour now provided
    via a library
      import scala.util.control.Breaks._
      breakable {
          for(e <- l) if(p(e)) f(p) else break // Continue from *
      }
      // *
Type Constructor Inference
●
    Type constructor polymorphism originally
    introduced in 2.5.0.
●
    Intention was to provide natural types for
    collection methods
●
    Lack of type inference made this difficult in
    practice — new collections use alternative
●
    Patch being reviewed for 2.8.0, but not yet
    clear if it will be included
Named and Default Arguments
●
    Method arguments can be supplied by
    name instead of position
      def resize(width: Int, height: Int) = { ... }
      resize(width = 120, height = 42)

●
    Method definitions can provide default
    arguments as an alternative to overloading
      def encode(s : String, encoding : String = “UTF-8”)
      encode(“Hello world”) // Uses default encoding
      encode(“Hello world”, “ISO-8859-1”) // Uses supplied

●
    Allows support for nested annotations
Functional Objects
●
    An appliction of named and default
    arguments
●
    Functional update for case classes
      case class Complex(val re : Double, val im : Double)
      val c1 = Complex(1.0, -1.0)
      val c2 = c1.copy(re = 2.0) // c2 == Complex(2.0, -1.0)

●
    Tuples are case classes so they inherit this
    behaviour
      val p1 = (23, “foo”)
      val p2 = p1.copy(_2 = “bar”) // p2 = (23, “bar)
Delimited Continuations
●
    Powerful control abstraction capturing the
    concept of “the rest of the computation”
●
    Can be used to build coroutines,
    generators and more exotic things (type-
    safe printf)
●
    Enable event-driven I/O models without
    requiring explict state machines
●
    Initially being provided via a compiler
    plugin
Delimited Continuations
●
    call/cc (Scheme etc.) capture the entire
    subsequent control flow
●
    Scala continuations capture control flow
    within a delimited region (shift/reset)
      import scala.continuations._
      import scala.continuations.ControlContext._
      val result =
         reset {
            shift {
               s : (String => String) => s(“Hello”)
            } + “ world”
         } // result == “Hello world”
Delimited Continuations
●
    Can be stored for later execution
      var stored : (String => String) = _
      reset {
          shift {
             s : (String => String) => stored = s
          } + " world"
      }
      stored("Hello") // == “Hello world”

    This enables complex control flow
    behaviours
●
    Can be serialized for remote execution
Type Specialization
●
    Adding @specialize annotation to generic
    type parameter — compiler generates
    specialized versions of
●
    Can eliminate expensive boxing and
    unboxing with higher order functions and
    arrays.
●
    Significantly reduce the cost of abstraction
●
    Nb. this doesn't eliminate erasure in
    general
The Scala IDE for Eclipse
●
    Integration with the JDT continues
●
    Much functionality migrated to scalac
    ●
        New interface for extracting semantic
        information for hyperlinks, hovers, completion
    ●
        New build manager
●
    More robust basic functionality
●
    Dramatic simplification of the codebase
    ●
        More maintainable
    ●
        Lower barrier to contributions
What's new in Scala and the
Scala IDE for Eclipse for 2.8.0




               Miles Sabin, Chuusai Ltd.
               http://www.chuusai.com/

More Related Content

What's hot

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
 
Intro to Java 8 Closures (Dainius Mezanskas)
Intro to Java 8 Closures (Dainius Mezanskas)Intro to Java 8 Closures (Dainius Mezanskas)
Intro to Java 8 Closures (Dainius Mezanskas)
Kaunas Java User Group
 
Clojure - An Introduction for Lisp Programmers
Clojure - An Introduction for Lisp ProgrammersClojure - An Introduction for Lisp Programmers
Clojure - An Introduction for Lisp Programmers
elliando dias
 
Clojure - An Introduction for Java Programmers
Clojure - An Introduction for Java ProgrammersClojure - An Introduction for Java Programmers
Clojure - An Introduction for Java Programmers
elliando dias
 
Introduction to apache_cassandra_for_developers-lhg
Introduction to apache_cassandra_for_developers-lhgIntroduction to apache_cassandra_for_developers-lhg
Introduction to apache_cassandra_for_developers-lhg
zznate
 

What's hot (20)

Writing Java Stored Procedures in Oracle 12c
Writing Java Stored Procedures in Oracle 12cWriting Java Stored Procedures in Oracle 12c
Writing Java Stored Procedures in Oracle 12c
 
Project kepler compile time metaprogramming for scala
Project kepler compile time metaprogramming for scalaProject kepler compile time metaprogramming for scala
Project kepler compile time metaprogramming for scala
 
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
 
Reaching the lambda heaven
Reaching the lambda heavenReaching the lambda heaven
Reaching the lambda heaven
 
Intro to Java 8 Closures (Dainius Mezanskas)
Intro to Java 8 Closures (Dainius Mezanskas)Intro to Java 8 Closures (Dainius Mezanskas)
Intro to Java 8 Closures (Dainius Mezanskas)
 
Should i Go there
Should i Go thereShould i Go there
Should i Go there
 
Parallel Programming
Parallel ProgrammingParallel Programming
Parallel Programming
 
Kubernetes Internals
Kubernetes InternalsKubernetes Internals
Kubernetes Internals
 
Functional java 8
Functional java 8Functional java 8
Functional java 8
 
Neodev
NeodevNeodev
Neodev
 
Clojure - An Introduction for Lisp Programmers
Clojure - An Introduction for Lisp ProgrammersClojure - An Introduction for Lisp Programmers
Clojure - An Introduction for Lisp Programmers
 
Understanding Implicits in Scala
Understanding Implicits in ScalaUnderstanding Implicits in Scala
Understanding Implicits in Scala
 
Plpgsql internals
Plpgsql internalsPlpgsql internals
Plpgsql internals
 
Distributed Model Validation with Epsilon
Distributed Model Validation with EpsilonDistributed Model Validation with Epsilon
Distributed Model Validation with Epsilon
 
Clojure - An Introduction for Java Programmers
Clojure - An Introduction for Java ProgrammersClojure - An Introduction for Java Programmers
Clojure - An Introduction for Java Programmers
 
CS6270 Virtual Machines - Java Virtual Machine Architecture and APIs
CS6270 Virtual Machines - Java Virtual Machine Architecture and APIsCS6270 Virtual Machines - Java Virtual Machine Architecture and APIs
CS6270 Virtual Machines - Java Virtual Machine Architecture and APIs
 
Scala
ScalaScala
Scala
 
Introduction to apache_cassandra_for_developers-lhg
Introduction to apache_cassandra_for_developers-lhgIntroduction to apache_cassandra_for_developers-lhg
Introduction to apache_cassandra_for_developers-lhg
 
Introduction to LAVA Workload Scheduler
Introduction to LAVA Workload SchedulerIntroduction to LAVA Workload Scheduler
Introduction to LAVA Workload Scheduler
 
Java.util.concurrent.concurrent hashmap
Java.util.concurrent.concurrent hashmapJava.util.concurrent.concurrent hashmap
Java.util.concurrent.concurrent hashmap
 

Similar to What's new in Scala and the Scala IDE for Eclipse for 2.8.0

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
 
BCS SPA 2010 - An Introduction to Scala for Java Developers
BCS SPA 2010 - An Introduction to Scala for Java DevelopersBCS SPA 2010 - An Introduction to Scala for Java Developers
BCS SPA 2010 - An Introduction to Scala for Java Developers
Miles Sabin
 
Building Server Applications Using ObjectiveC And GNUstep
Building Server Applications Using ObjectiveC And GNUstepBuilding Server Applications Using ObjectiveC And GNUstep
Building Server Applications Using ObjectiveC And GNUstep
guest9efd1a1
 
Building Server Applications Using Objective C And Gn Ustep
Building Server Applications Using Objective C And Gn UstepBuilding Server Applications Using Objective C And Gn Ustep
Building Server Applications Using Objective C And Gn Ustep
wangii
 
[Strukelj] Why will Java 7.0 be so cool
[Strukelj] Why will Java 7.0 be so cool[Strukelj] Why will Java 7.0 be so cool
[Strukelj] Why will Java 7.0 be so cool
javablend
 

Similar to What's new in Scala and the Scala IDE for Eclipse for 2.8.0 (20)

Short intro to scala and the play framework
Short intro to scala and the play frameworkShort intro to scala and the play framework
Short intro to scala and the play framework
 
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
 
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
 
BCS SPA 2010 - An Introduction to Scala for Java Developers
BCS SPA 2010 - An Introduction to Scala for Java DevelopersBCS SPA 2010 - An Introduction to Scala for Java Developers
BCS SPA 2010 - An Introduction to Scala for Java Developers
 
An Introduction to Scala for Java Developers
An Introduction to Scala for Java DevelopersAn Introduction to Scala for Java Developers
An Introduction to Scala for Java Developers
 
Scala and jvm_languages_praveen_technologist
Scala and jvm_languages_praveen_technologistScala and jvm_languages_praveen_technologist
Scala and jvm_languages_praveen_technologist
 
Road to sbt 1.0: Paved with server (2015 Amsterdam)
Road to sbt 1.0: Paved with server (2015 Amsterdam)Road to sbt 1.0: Paved with server (2015 Amsterdam)
Road to sbt 1.0: Paved with server (2015 Amsterdam)
 
What is Java Technology (An introduction with comparision of .net coding)
What is Java Technology (An introduction with comparision of .net coding)What is Java Technology (An introduction with comparision of .net coding)
What is Java Technology (An introduction with comparision of .net coding)
 
Software Frameworks for Deep Learning (D1L7 2017 UPC Deep Learning for Comput...
Software Frameworks for Deep Learning (D1L7 2017 UPC Deep Learning for Comput...Software Frameworks for Deep Learning (D1L7 2017 UPC Deep Learning for Comput...
Software Frameworks for Deep Learning (D1L7 2017 UPC Deep Learning for Comput...
 
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
 
Scala - core features
Scala - core featuresScala - core features
Scala - core features
 
Spring Day | Spring and Scala | Eberhard Wolff
Spring Day | Spring and Scala | Eberhard WolffSpring Day | Spring and Scala | Eberhard Wolff
Spring Day | Spring and Scala | Eberhard Wolff
 
Building Server Applications Using ObjectiveC And GNUstep
Building Server Applications Using ObjectiveC And GNUstepBuilding Server Applications Using ObjectiveC And GNUstep
Building Server Applications Using ObjectiveC And GNUstep
 
Building Server Applications Using Objective C And Gn Ustep
Building Server Applications Using Objective C And Gn UstepBuilding Server Applications Using Objective C And Gn Ustep
Building Server Applications Using Objective C And Gn Ustep
 
Java Course 15: Ant, Scripting, Spring, Hibernate
Java Course 15: Ant, Scripting, Spring, HibernateJava Course 15: Ant, Scripting, Spring, Hibernate
Java Course 15: Ant, Scripting, Spring, Hibernate
 
Annotations
AnnotationsAnnotations
Annotations
 
[Strukelj] Why will Java 7.0 be so cool
[Strukelj] Why will Java 7.0 be so cool[Strukelj] Why will Java 7.0 be so cool
[Strukelj] Why will Java 7.0 be so cool
 

More from Miles Sabin (6)

Scaladays 2010 - The Scala IDE for Eclipse - Retrospect and Prospect for 2.8 ...
Scaladays 2010 - The Scala IDE for Eclipse - Retrospect and Prospect for 2.8 ...Scaladays 2010 - The Scala IDE for Eclipse - Retrospect and Prospect for 2.8 ...
Scaladays 2010 - The Scala IDE for Eclipse - Retrospect and Prospect for 2.8 ...
 
Eclipsecon 2010 - Scala Support in Eclipse
Eclipsecon 2010 - Scala Support in EclipseEclipsecon 2010 - Scala Support in Eclipse
Eclipsecon 2010 - Scala Support in Eclipse
 
A Brief Introduction to Scala for Java Developers
A Brief Introduction to Scala for Java DevelopersA Brief Introduction to Scala for Java Developers
A Brief Introduction to Scala for Java Developers
 
Scala Support in Eclipse - Monkey-patching the JDT for fun and profit?
Scala Support in Eclipse - Monkey-patching the JDT for fun and profit?Scala Support in Eclipse - Monkey-patching the JDT for fun and profit?
Scala Support in Eclipse - Monkey-patching the JDT for fun and profit?
 
JVM Languages Support in Eclipse - Monkey-patching the JDT for fun and profit?
JVM Languages Support in Eclipse - Monkey-patching the JDT for fun and profit?JVM Languages Support in Eclipse - Monkey-patching the JDT for fun and profit?
JVM Languages Support in Eclipse - Monkey-patching the JDT for fun and profit?
 
The Scala IDE for Eclipse - Retrospect and Prospect for 2.8.0
The Scala IDE for Eclipse - Retrospect and Prospect for 2.8.0The Scala IDE for Eclipse - Retrospect and Prospect for 2.8.0
The Scala IDE for Eclipse - Retrospect and Prospect for 2.8.0
 

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@
 

Recently uploaded (20)

Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
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
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
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...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
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
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
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
 
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...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 

What's new in Scala and the Scala IDE for Eclipse for 2.8.0

  • 1. What's new in Scala and the Scala IDE for Eclipse for 2.8.0 Miles Sabin, Chuusai Ltd. http://www.chuusai.com/
  • 2. Vastly Improved REPL ● Read Eval Print Loop: Interactive interpreter ● Unusual for a statically typed JVM language ● New maintainer: Paul Phillips ● New for 2.8.0 ● Completion (packages, classes, members) ● Interactive debugging
  • 3. New Collection Libraries ● Collections in <= 2.7.5 ● Evolved haphazardly ● Hard work for implementors ● Code duplication to avoid unnatural types ● Unpredictable performance ● Java interoperability incomplete
  • 4. New Collection Libraries ● Collections in 2.8.0 ● Coherent design in terms of traversals and builders ● Builders support natural types ● Systematic sharing reduces duplication ● Lazy views now explicit ● Java interoperability conversion bidirectional ● Minimal impact on clients
  • 5. New Collection Libraries Traversable Iterable Map Set Sequence SortedMap SortedSet BitSet Buffer Vector LinearSequence
  • 6. Package Objects ● How to support clients expecting old package layout? ● Package objects support additional members not on any class, trait, object package object scala { type List[+A] = scala.collection.immutable.List[A] val List = scala.collection.immutable.List ... } ● Can be used by any library provider
  • 7. Break (but not continue) ● Scala promotes functional styles — this can trip up imperative programmers for(e <- l) if(p(e)) f(p) else ??? // How to bail out? ● Traditional break behaviour now provided via a library import scala.util.control.Breaks._ breakable { for(e <- l) if(p(e)) f(p) else break // Continue from * } // *
  • 8. Type Constructor Inference ● Type constructor polymorphism originally introduced in 2.5.0. ● Intention was to provide natural types for collection methods ● Lack of type inference made this difficult in practice — new collections use alternative ● Patch being reviewed for 2.8.0, but not yet clear if it will be included
  • 9. Named and Default Arguments ● Method arguments can be supplied by name instead of position def resize(width: Int, height: Int) = { ... } resize(width = 120, height = 42) ● Method definitions can provide default arguments as an alternative to overloading def encode(s : String, encoding : String = “UTF-8”) encode(“Hello world”) // Uses default encoding encode(“Hello world”, “ISO-8859-1”) // Uses supplied ● Allows support for nested annotations
  • 10. Functional Objects ● An appliction of named and default arguments ● Functional update for case classes case class Complex(val re : Double, val im : Double) val c1 = Complex(1.0, -1.0) val c2 = c1.copy(re = 2.0) // c2 == Complex(2.0, -1.0) ● Tuples are case classes so they inherit this behaviour val p1 = (23, “foo”) val p2 = p1.copy(_2 = “bar”) // p2 = (23, “bar)
  • 11. Delimited Continuations ● Powerful control abstraction capturing the concept of “the rest of the computation” ● Can be used to build coroutines, generators and more exotic things (type- safe printf) ● Enable event-driven I/O models without requiring explict state machines ● Initially being provided via a compiler plugin
  • 12. Delimited Continuations ● call/cc (Scheme etc.) capture the entire subsequent control flow ● Scala continuations capture control flow within a delimited region (shift/reset) import scala.continuations._ import scala.continuations.ControlContext._ val result = reset { shift { s : (String => String) => s(“Hello”) } + “ world” } // result == “Hello world”
  • 13. Delimited Continuations ● Can be stored for later execution var stored : (String => String) = _ reset { shift { s : (String => String) => stored = s } + " world" } stored("Hello") // == “Hello world” This enables complex control flow behaviours ● Can be serialized for remote execution
  • 14. Type Specialization ● Adding @specialize annotation to generic type parameter — compiler generates specialized versions of ● Can eliminate expensive boxing and unboxing with higher order functions and arrays. ● Significantly reduce the cost of abstraction ● Nb. this doesn't eliminate erasure in general
  • 15. The Scala IDE for Eclipse ● Integration with the JDT continues ● Much functionality migrated to scalac ● New interface for extracting semantic information for hyperlinks, hovers, completion ● New build manager ● More robust basic functionality ● Dramatic simplification of the codebase ● More maintainable ● Lower barrier to contributions
  • 16. What's new in Scala and the Scala IDE for Eclipse for 2.8.0 Miles Sabin, Chuusai Ltd. http://www.chuusai.com/