Why

      Scala
        for Web 2.0?
Hi.

I’m Alex Payne,
API Lead at Twitter, Inc.

Also, co-author of
Programming Scala,
out later this year from O’Reilly.
A brief history of the
languages behind Web 2.0.
Let’s talk about
recession engineering.
Can we still afford
to build
things we love
with tools we love?
fast
functional
expressive
statically typed
object-oriented
concurrent
beautiful
C
                   C++
                   Ruby
                    PHP
                 Python
                 Erlang
 ...
And then, there’s Scala.
Features.
Java compatibility
keeps your ROI returning.
Actors
keep concurrency simple.
Immutability
keeps concurrency predictable.
Type inference
keeps code clean.
First-class functions
keep things exible.
Traits
keep behavior reusable.
Pattern matching
keeps your needles out of haystacks.
XML literals and query methods
keep XML tolerable.
More:
case classes
properties
existential types
implicit conversions
lazy evaluation
parser combinators
monads
annotations...
The price: complexity.
But it’s worth it.
Wins.
A queuing system that
takes the hits.
An API test suite that
helps us sleep.
People search that
returns in milliseconds.
Community.
Groups:
Bay Area Scala Enthusiasts (BASE)
Chicago Area Scala Enthusiasts (CASE)
New York Scala Enthusiasts (NYSE)
etc. etc.
Education:
Programming Scala
Programming in Scala
The Busy Java Developer’s Guide...
Why Scala?
Introduction to High-Level...
Blogs &c.:
Code Commit
Coderspiel
Scala-Blogs
Graceless Failures
Delicious
Reddit
FriendFeed
Twitter Search
Tools:
IDEs: Eclipse, NetBeans, IDEA
Editors: Emacs, VIM, TextMate
JavaRebel
Whatever JVM tools you like!
Libraries and frameworks
Lift
Specs
ScalaCheck
Con ggy
Scalax, Scalaz
every Java library ever
even libraries in other JVM ...
So, why Scala for Web 2.0?
Thank you. Questions?

          scala-lang.org
         bit.ly/progscala
        twitter.com/al3x
              al3x.net
Upcoming SlideShare
Loading in...5
×

Why Scala for Web 2.0?

37,595

Published on

A presentation to Web 2.0 Expo San Francisco, arguing for Scala as an ideal language for social web businesses.

Published in: Technology
3 Comments
88 Likes
Statistics
Notes
No Downloads
Views
Total Views
37,595
On Slideshare
0
From Embeds
0
Number of Embeds
5
Actions
Shares
0
Downloads
790
Comments
3
Likes
88
Embeds 0
No embeds

No notes for slide

  • Came to previous C4s for Io, Erlang. Have programmed for money in Java, JavaScript, C, PHP, Perl, Ruby, and Python. Have programmed for fun, love, or spite in x86 Assembly, Erlang, Lua, Objective-C, various Lisps, Haskell, O-Caml, C++, Io, Erlang.
  • Ruby’s poor VM performance, monkeypatching and cultural issues, questionable for large systems. We had new services to build, didn’t want to continue with Ruby.
  • Ruby’s poor VM performance, monkeypatching and cultural issues, questionable for large systems. We had new services to build, didn’t want to continue with Ruby.
  • Ruby’s poor VM performance, monkeypatching and cultural issues, questionable for large systems. We had new services to build, didn’t want to continue with Ruby.
  • My personal criteria for a good systems language.
  • Why not these languages? Talk about their issues. We ultimately knew we wanted a JVM language, just not Java.
  • Ruby’s poor VM performance, monkeypatching and cultural issues, questionable for large systems. We had new services to build, didn’t want to continue with Ruby.

  • The JVM has chops. Address Java interoperability, Martin Odersky’s credentials, etc. Worse comes to worse, just fall back to Java. Most other JVM-hosted languages can’t claim the same speed as Scala.
  • The “concurrency crisis” has been underway since the early 1990s. Ref: HOPL2 intro speech.
    Scala handles actors as nicely as Erlang and Io. Actors are neat, but we haven’t made extensive use of them at Twitter just yet. Also Pi and Join Calculi.
  • A pragmatic approach to data structure mutability. Most data structures available in mutable and immutable flavors. Requires thoughtful decision-making, but that pays off.
  • Static typing is a blessing and a curse. Scala lets you ignore typing until you can put it to work for you.
  • Once you have this feature in a language, you simply can’t do without it. Passing functions around is awesome - a bit like function pointers. Also: “higher-order” methods (methods that take other methods, like ‘map’), anonymous methods. Everything is an expression, everything has a value.
  • Once you’ve gotten used to Ruby’s modules, it’s another difficult language feature to give up. Subclassing can be a nightmare, and isn’t always the correct design solution. Traits enable powerful abstraction of cross-cutting concerns.
  • Every programmer matches patterns all day, every day. It’s just that most languages don’t have a lexical facility for making that task easier.
  • XML ain’t going away any time soon. If you have to interact with XML a lot, Scala is an awesome choice. It’s got that JavaScript+JSON peanut butter n’ jelly quality.
  • Address those features particular to Scala: case classes, properties, existential types, implicits.
  • The bad, the ugly.

  • Ruby’s poor VM performance, monkeypatching and cultural issues, questionable for large systems. We had new services to build, didn’t want to continue with Ruby.
  • Ruby’s poor VM performance, monkeypatching and cultural issues, questionable for large systems. We had new services to build, didn’t want to continue with Ruby.
  • Ruby’s poor VM performance, monkeypatching and cultural issues, questionable for large systems. We had new services to build, didn’t want to continue with Ruby.








  • Why Scala for Web 2.0?

    1. 1. Why Scala for Web 2.0?
    2. 2. Hi. I’m Alex Payne, API Lead at Twitter, Inc. Also, co-author of Programming Scala, out later this year from O’Reilly.
    3. 3. A brief history of the languages behind Web 2.0.
    4. 4. Let’s talk about recession engineering.
    5. 5. Can we still afford to build things we love with tools we love?
    6. 6. fast functional expressive statically typed object-oriented concurrent beautiful
    7. 7. C C++ Ruby PHP Python Erlang Java [JVM dynamic languages]
    8. 8. And then, there’s Scala.
    9. 9. Features.
    10. 10. Java compatibility keeps your ROI returning.
    11. 11. Actors keep concurrency simple.
    12. 12. Immutability keeps concurrency predictable.
    13. 13. Type inference keeps code clean.
    14. 14. First-class functions keep things exible.
    15. 15. Traits keep behavior reusable.
    16. 16. Pattern matching keeps your needles out of haystacks.
    17. 17. XML literals and query methods keep XML tolerable.
    18. 18. More: case classes properties existential types implicit conversions lazy evaluation parser combinators monads annotations ... !
    19. 19. The price: complexity. But it’s worth it.
    20. 20. Wins.
    21. 21. A queuing system that takes the hits.
    22. 22. An API test suite that helps us sleep.
    23. 23. People search that returns in milliseconds.
    24. 24. Community.
    25. 25. Groups: Bay Area Scala Enthusiasts (BASE) Chicago Area Scala Enthusiasts (CASE) New York Scala Enthusiasts (NYSE) etc. etc.
    26. 26. Education: Programming Scala Programming in Scala The Busy Java Developer’s Guide... Why Scala? Introduction to High-Level Prog’ing... Scala Language Speci cation
    27. 27. Blogs &c.: Code Commit Coderspiel Scala-Blogs Graceless Failures Delicious Reddit FriendFeed Twitter Search
    28. 28. Tools: IDEs: Eclipse, NetBeans, IDEA Editors: Emacs, VIM, TextMate JavaRebel Whatever JVM tools you like!
    29. 29. Libraries and frameworks Lift Specs ScalaCheck Con ggy Scalax, Scalaz every Java library ever even libraries in other JVM languages!
    30. 30. So, why Scala for Web 2.0?
    31. 31. Thank you. Questions? scala-lang.org bit.ly/progscala twitter.com/al3x al3x.net
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.

    ×