News and Notes from the Makers of Nexus | Sonatype Blog

Technology Focus: What is Scala?

Written by Tim OBrien | February 20, 2012

Two weeks ago we talked about how many of the projects hosted in Scala Tools are moving over to publish directly to Central. That process is ongoing. In this post, I want to start something new. At Sonatype we touch a lot of different technologies and communities, and I want to make sure that we're doing all we can to help put a spotlight on some of the communities that we're watching. Whether it is a .NET-focused open source foundation like Outercurve, a customer that contributes back to Nexus OSS or, in this post, the Scala community, I think that Sonatype can at least help introduce some of these interesting technologies to a larger audience.


So, what is Scala?

The JVM saw an explosion of "alternative" languages over the past several years. From clojure to jruby to scala, each language tends to have a specific "sweet-spot" it solves more efficiently than other languages. If you are interested in rapid web development, JRuby has become a solid option alongside Rails.
Scala’s “sweet spot” is providing a functional programming language that provides an elegant way to think about concurrency and parallelism while integrating concepts of OO programming. Where languages like Ruby and Python have become logical choices for front-end web development, Scala has increasingly become the default choice for the kinds of massively parallel systems that make sites like Twitter, LinkedIn, and Google run. Scala’s applications range from large-scale scientific simulations, to high-speed, algorithmic trading applications, to systems like ad-exchanges.
Here are some interesting people, projects, and companies that use Scala:

  • Martin Odersky, creator of Scala, co-founder of Typesafe, discussed trends in parallelism that drive Scala at O’Reilly’s OSCON ‘11. This is a great if you are looking for some motivation behind functional programming.
  • Everytime you Tweet, you Scala – Also from O’Reilly’s OSCON ‘11 Raffi Krikorian from Twitter discussed Twitter’s migration from a Ruby on Rails architecture, to an architecture that relies on Rails as a Front-end, Scala as a foundation for web-scale storage and retrieval.
  • Scala at Square – Square’s a mobile payment service poised to garner some big attention this year as several major US presidential campaigns have adopted it as a mobile payment platform. Well, if you Square, you are also making use of Scala. Bob Lee, the CTO of Square mentioned Scala in his OSCON talk about a coming Java renaissance.
  • Use Quora? You also use Scala. – According to this answer on Quora, Quora engineer Kah Seng Tay suggests that Quora is moving some systems to Scala because it is "fast, concise, type-safe, object-oriented yet functional, easy parallelism, extensible and built on the JVM".
  • Foursquare, Sony, Xerox, Siemens, The Guardian, Novell, LinkedIn, and more examples at scala-lang.org.

Note: What about Lift? Or Scala-tools? Why didn't I mention X, Y, or Z? We're not done featuring interesting Scala projects, this is the just the first installment.

When you Scala do you use Maven or SBT?

Now, you might assume that Sonatype has a definite opinion in this space. After all, didn’t we write a series of Maven books?

Yes, we did, but we’re also an increasingly "tool agnostic" company. While you’ll see a good number of our examples focus on Maven, we understand that the world uses more than one build tool.
In Scalaland, it’s a choice between the maven-scala-plugin and SBT. Both seem to present a solid option with most pure Scalaist seeming to prefer SBT over Maven. There was a discussion at scala-lang.org about the relative merits of SBT vs. Maven in December of 2011, and it looks like there are a equal number of people suggesting SBT vs Maven.

Whatever you use, your build tool is still going to download from Central, and it would benefit from using a local repository manager like Nexus. In the next installment of our Scala coverage we'll talk about how to use Scala with a repository manager.

One last thing.... The other nice thing about Scala is that Scala skills are in high demand. Every time I speak with someone running an organization that uses Scala, they are always looking for people familiar with Scala. Most companies that use Scala, end up having to just hire smart developers and train them on Scala. It's clear that knowing Scala well will put you in an advantage for a particular type of company that is engaged in "big data" work. For example, last I heard Square was looking for Scala talent.