• Like
  • Save
Scala
Upcoming SlideShare
Loading in...5
×
 

Scala

on

  • 1,140 views

Presentation about Twitter's use of Scala

Presentation about Twitter's use of Scala

Statistics

Views

Total Views
1,140
Views on SlideShare
1,140
Embed Views
0

Actions

Likes
2
Downloads
14
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Apple Keynote

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • \n
  • 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.\n
  • 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.\n
  • 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.\n
  • 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.\n
  • My personal criteria for a good systems language.\n
  • Why not these languages? Talk about their issues. We ultimately knew we wanted a JVM language, just not Java.\n
  • 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.\n
  • \n
  • 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.\n
  • The “concurrency crisis” has been underway since the early 1990s. Ref: HOPL2 intro speech.\nScala 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.\n
  • A pragmatic approach to data structure mutability. Most data structures available in mutable and immutable flavors. Requires thoughtful decision-making, but that pays off.\n
  • Static typing is a blessing and a curse. Scala lets you ignore typing until you can put it to work for you.\n
  • 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. \n
  • 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.\n
  • 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. \n
  • 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.\n
  • Address those features particular to Scala: case classes, properties, existential types, implicits.\n
  • The bad, the ugly.\n
  • \n
  • 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.\n
  • 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.\n
  • 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.\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n

Scala Scala Presentation Transcript

  • Why Scala for Web 2.0?
  • Hi.I’m Alex Payne,API Lead at Twitter, Inc.Also, co-author ofProgramming Scala,out later this year from O’Reilly.
  • A brief history of thelanguages behind Web 2.0.
  • Let’s talk aboutrecession engineering.
  • Can we still affordto buildthings we lovewith tools we love?
  • fastfunctionalexpressivestatically typedobject-orientedconcurrentbeautiful
  • C C++ Ruby PHP Python Erlang Java[JVM dynamic languages]
  • And then, there’s Scala.
  • Features.
  • Java compatibilitykeeps your ROI returning.
  • Actorskeep concurrency simple.
  • Immutabilitykeeps concurrency predictable.
  • Type inferencekeeps code clean.
  • First-class functionskeep things exible.
  • Traitskeep behavior reusable.
  • Pattern matchingkeeps your needles out of haystacks.
  • XML literals and query methodskeep XML tolerable.
  • More:case classespropertiesexistential typesimplicit conversionslazy evaluationparser combinatorsmonadsannotations... !
  • The price: complexity.But it’s worth it.
  • Wins.
  • A queuing system thattakes the hits.
  • An API test suite thathelps us sleep.
  • People search thatreturns in milliseconds.
  • Community.
  • Groups:Bay Area Scala Enthusiasts (BASE)Chicago Area Scala Enthusiasts (CASE)New York Scala Enthusiasts (NYSE)etc. etc.
  • Education:Programming ScalaProgramming in ScalaThe Busy Java Developer’s Guide...Why Scala?Introduction to High-Level Prog’ing...Scala Language Speci cation
  • Blogs &c.:Code CommitCoderspielScala-BlogsGraceless FailuresDeliciousRedditFriendFeedTwitter Search
  • Tools:IDEs: Eclipse, NetBeans, IDEAEditors: Emacs, VIM, TextMateJavaRebelWhatever JVM tools you like!
  • Libraries and frameworksLiftSpecsScalaCheckCon ggyScalax, Scalazevery Java library evereven libraries in other JVM languages!
  • So, why Scala for Web 2.0?
  • Thank you. Questions? scala-lang.org bit.ly/progscala twitter.com/al3x al3x.net