BT

Your opinion matters! Please fill in the InfoQ Survey!

After a Quiet 2015 Martin Odersky Outlined Significant Plans for Scala at Scala Days New York

| by Michael Redlich Follow 6 Followers on Aug 02, 2016. Estimated reading time: 5 minutes |

A note to our readers: As per your request we have developed a set of features that allow you to reduce the noise, while not losing sight of anything that is important. Get email and web notifications by choosing the topics you are interested in.

After a relatively quiet 2015, father of Scala Martin Odersky announced during his May 9, 2016 keynote address at Scala Days New York, that development is “heating up” for Scala this year. Odersky, who is currently programming research group professor at the École Polytechnique Fédérale de Lausanne (EPFL), and chairman and co-founder of Lightbend, outlined “what has recently happened or will happen very soon”:

  • The Scala Center
  • Scala 2.12
  • Plans to rethink the Scala libraries
  • Development of new target platforms
  • DOT and Dotty

We present a round-up of all the major announcements here.

Scala Center

Odersky introduced the new Scala Center, chartered to “undertake projects that benefit all of the Scala community.” As reported in the March 14, 2016 Scala Center blog post, the Scala Center was created due to an increase in available Scala positions as well as a Google search on “scala tutorial,” indicating a steady rise in adoption of Scala. The main focus is on the open source community and education. It was also created to work closely with the Scala community as the aforementioned blog post describes:

The large user base and the diversity of projects built on Scala mean that there are many demands on the language and its tool set. There is also a large pool of capable and motivated contributors. The first mission of the Scala Center is to consult with the user community, define common goals, and organize contributions and its own resources to achieve these goals.

The Scala Center is located at EPFL and is led by research scientist Heather Miller, who serves as executive director. Adriaan Moors, Scala tech lead at Lightbend, serves on the board of the Scala Center. He spoke to InfoQ regarding Lightbend’s involvement with the Scala Center. When asked if Lightbend’s day-to-day activities have been affected by the Scala Center, Moors said:

It’s influencing our planning, but it’s too early to say it’s really impacted our daily work so far. The whole Scala team at Lightbend is completely focused on getting the best possible 2.12.0-RC1 release out in the next few weeks, and this is something we remain solely responsible for (with many contributions from the community, of course!).

Among the many organizations that have adopted Scala, Lightbend has case studies on 62 of them.

Scala 2.12

The road to Scala 2.12 has been on-going for two years and is scheduled to be released mid-2016 (Scala 2.12.0 milestone 5 was available since June 29, 2016). It will be the first Java 8 optimized release and will utilize Java 8’s lambdas to produce shorter code and faster execution. Scala 2.12 has 33 new features documented in the Scala GitHub repository. Lightbend will provide an extended maintenance cycle for Scala 2.11 for applications still running with Java 6/7.

DOT

Eight years in the making, the DOT - a “calculus” of document object types - has proven to be a sound foundation of Scala. As defined in Odersky’s February 3, 2016 blog post:

A calculus is a kind of mini-language that is small enough to be studied formally. Translated to Scala notation, the language covered by DOT is described by the following abstract grammar:

As defined in the DOT calculus GitHub repository, the abstract grammar above is:

A minimally complete version of dependent object types. The calculus comprises functions, labeled types and terms combined through intersections, recursive bindings, and nothing else.

The calculus was chosen so that formal statements can be made and proved along with encoding the rest of the language in it. This provides more confidence in future development of Scala. The calculus allows for type soundness. Typing rules assign types to terms and evaluation rules ensure correct evaluation of a program as the following property demonstrates:

If term t has type T, and evaluation of t terminates, the result will be a value v of type T.

The importance of this, as Odersky explained, is that “it gives us a technique to reason about correctness of other language features.”

Dotty

Dotty is a new compiler using the internal data structures of DOT. Its code base is almost half the size of the current nsc compiler and promises to be twice as fast. Dotty will include a host of new features:

  • Intersection types (corrects an issue with types not being commutative)
  • Union types (avoids huge construction overhead)
  • Function arity adaption (more efficient parameter mapping)
  • Trait parameters (trait being synonymous to an interface in Java)
  • @static methods and fields
  • Multiversal equality (operators, such as == and !=, are now type safe)
  • Named type parameters

Motivations for these new features include a better foundation and a language that is easier and safer to use. The current status of these features can be found on the Dotty website.

To keep the language simple, Odersky announced that some current features of Scala will be dropped:

  • Procedure Syntax (not very efficient)
  • DelayedInit class (wasn’t being used)
  • Macros (experimental and not in the long-term plan)
  • Early initializers (replaced by Trait parameters)
  • Existential types (didn’t fit with Scala foundations)
  • General Type Projection (determined to be type un-sound)

Some of these features will be replaced by the new ones or simply eliminated.

Advanced tooling for Dotty include:

  • Basic integration with Scala’s sbt build tool
  • Interactive REPL (read-eval-print-loop) with syntax highlighting
  • A new IntelliJ Dotty plug-in
  • Document generation (dynamic hyperlinks for cross-linking libraries)
  • A new efficient and more robust linker

Dotty is built as shown in the diagram:

A new serialized typed abstract syntax tree, TASTY, is introduced and is designed to be compact, lazy, extensible, and precise. Dotty is being developed at EPFL, but the Scala team at Lightbend will be responsible for infrastructure, reviews, and suggestions. Source code can be found on the Dotty GitHub repository.

Scala 2.12 and Beyond

Planning ahead for Scala 2.13, the focus will be to study ways to revamp the libraries to make them easier to use while removing any existing corner cases. Odersky stated that inspiration came from Spark’s implementation of collections with their Resilient Distributed Datasets (RDDs) to lazily construct collection operations.

For better modulation of the Scala libraries, Odersky proposed a split of Scala stdlib:

Odersky invited developers to participate in existing and new strawman proposals.

Conclusion

Moors maintains the official GitHub repository for the Scala programming language that provides source code and information on how developers can contribute.

Lightbend told InfoQ that later this summer, they are “planning to unveil the findings of a survey of a couple thousand Java and Scala developers sharing their experiences around containers, microservices, cloud-native applications and some other hot areas.”

Rate this Article

Adoption Stage
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

biggest downside of scala by peter lin

why is it that every new release has backward compatibility issues? It makes it tough to recommend it to others. It's an interesting language, but having compatibility issues from one release to another really makes life harder than it needs to be.

Re: biggest downside of scala by Luis Espinal

why is it that every new release has backward compatibility issues? It makes it tough to recommend it to others. It's an interesting language, but having compatibility issues from one release to another really makes life harder than it needs to be.


I haven't worked with Scala, but I've worked in projects where backward compatibility has been an issue. I must echo the sentiment. Breaking backward compatibility forces people to program against a lowest common denominator forsaking better solutions, and that's when you are lucky. Sometimes there is no way to abstract out (and protect yourself) from backward compatibility breakage.

DOT by Rob Scott

DOT stands for "dependent object types" not "document object types" as stated in the article.

Re: biggest downside of scala by Dan Osipov

Scala is working on addressing that issue with TASTY initiative.

Re: DOT by Michael Redlich

Oops, my bad...thanks for pointing that out...

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

5 Discuss

Login to InfoQ to interact with what matters most to you.


Recover your password...

Follow

Follow your favorite topics and editors

Quick overview of most important highlights in the industry and on the site.

Like

More signal, less noise

Build your own feed by choosing topics you want to read about and editors you want to hear from.

Notifications

Stay up-to-date

Set up your notifications and don't miss out on content that matters to you

BT