June 2‒3, 2011 Stanford University Stanford, Adays2011.scala-lang.org/sites/days2011/files/Scala...

28
June 2‒3, 2011 Stanford University Stanford, CA

Transcript of June 2‒3, 2011 Stanford University Stanford, Adays2011.scala-lang.org/sites/days2011/files/Scala...

Page 1: June 2‒3, 2011 Stanford University Stanford, Adays2011.scala-lang.org/sites/days2011/files/Scala Days... · 2011-06-02 · Samira Tasharofi, Milos Gligoric, Darko Marinov, and Ralph

June 2‒3, 2011

Stanford University Stanford, CA

Page 2: June 2‒3, 2011 Stanford University Stanford, Adays2011.scala-lang.org/sites/days2011/files/Scala Days... · 2011-06-02 · Samira Tasharofi, Milos Gligoric, Darko Marinov, and Ralph
Page 3: June 2‒3, 2011 Stanford University Stanford, Adays2011.scala-lang.org/sites/days2011/files/Scala Days... · 2011-06-02 · Samira Tasharofi, Milos Gligoric, Darko Marinov, and Ralph

June 2–3, 2011 Conference at a Glance

Time June 2 June 3

8:00a Registration

Lobby

Registration

Lobby

8:00a Breakfast

Lobby

Breakfast

Lobby

8:45a—9:00a Welcome Address

McCaw Hall

9:00a—10:00a Keynote:

State of Scala

Martin Odersky

McCaw Hall

Keynote:

Supporting the Many Flavors of Parallel Programming

Doug Lea

McCaw Hall

10:00a—10:25a Break

Lobby

Break

Lobby

10:25a—12:05p Workshop / Technical Talks

All Conference Rooms

Technical Talks

All Conference Rooms

12:05p—1:45p Lunch

Lobby

Lunch

Lobby

1:45p—3:25p Workshop / Technical Talks

All Conference Rooms

Technical Talks

All Conference Rooms

3:25p—3:50p Break

Lobby

Break

Lobby

3:50p—5:30p Workshop / Technical Talks

All Conference Rooms

Panel:

Scala in the Enterprise: What Will It Take?

McCaw Hall

5:45p—6:00p Bus Loading for Reception

6:30p—9:30p Reception and Dinner

Computer History Museum

Mountain View, CA

Page 4: June 2‒3, 2011 Stanford University Stanford, Adays2011.scala-lang.org/sites/days2011/files/Scala Days... · 2011-06-02 · Samira Tasharofi, Milos Gligoric, Darko Marinov, and Ralph
Page 5: June 2‒3, 2011 Stanford University Stanford, Adays2011.scala-lang.org/sites/days2011/files/Scala Days... · 2011-06-02 · Samira Tasharofi, Milos Gligoric, Darko Marinov, and Ralph

Reception

June 2, 2011

Computer History Museum Grand Hall – 2

nd Floor

1401 N. Shoreline Blvd Mountain View, CA 94043

650-810-1010

5:45 PM – 6 PM Board buses to Museum 6:15 PM – 7:30 PM Self-guided Museum tours Grand Hall: Wine and appetizers & Book signing 7:30 PM – 9 PM Dinner in Grand Hall 9:15 PM Board buses for return to Stanford University

Before you leave for the Reception: Since there is no lighting in the Galvez Parking Lot and you are leaving your ve-hicle at Stanford while you attend the Reception, please move it to the Visitor Center parking lot, which is across the street from the Galvez Parking Lot.

When you return from the Reception: The bus will offload passengers at the Visitor Center, which is at the corner of Campus Drive and Galvez. The bus will make the following additional stops: 1) Sheraton and Westin Hotels in Palo Alto and 2) the Palo Alto Caltrain station. We have made arrangements for taxis to be available at the Visitor Center parking lot for those who want transportation to their hotel.

Sponsored by

Page 6: June 2‒3, 2011 Stanford University Stanford, Adays2011.scala-lang.org/sites/days2011/files/Scala Days... · 2011-06-02 · Samira Tasharofi, Milos Gligoric, Darko Marinov, and Ralph

Time McCaw Hall Barnes, McDowell, & Cranston

June 2 8:45a—9:00a

Welcome Address Kunle Olukotun

June 2 9:00a—10:00a

Keynote: State of Scala Martin Odersky

June 2 10:25a—12:05p

MUTS: Native Scala Constructs for Software Transactional Memory Daniel Goodman, Behram Khan, Salman Khan, Chris Kirkham, Mikel Lujan and Ian Watson

Setac: A Framework for Phased Deterministic Testing of Scala Actor Programs Samira Tasharofi, Milos Gligoric, Darko Marinov, and Ralph Johnson

Parallelizing Machine Learning– Functionally: A Framework and Abstractions for Parallel Graph Processing Philipp Haller and Heather Miller

Liszt: A DSL for Solving Mesh-based PDEs Zach DeVito

Delite: A Framework for Heterogeneous Parallel DSLs Kevin Brown

OptiML on Delite: A DSL for Machine Learning Arvind Sujeeth

June 2 1:45p—3:25p

Scala.react: Embedded Reactive Programming in Scala Ingo Maier

Checking Flight Rules with TraceContract - Ap-plication of a Scala DSL for Trace Analysis Howard Barringer, Klaus Havelund, Elif Kurklu, and Robert Morris

Lafros MaCS Programmable Devices: Case Study in Type-Safe API Design using Scala Rob Dickens

ENSIME: The ENhanced Scala Interaction Mode for Emacs Aemon Cannon

The Scala IDE for Eclipse Reloaded Iulian Dragos

Type Debugger Hubert Plociniczak

June 2 3:50p—5:30p

Loop Recognition in C++/Java/Go/Scala Robert Hundt and Tipp Moseley

Compiling Scala to LLVM Geoffrey Reedy

Scala+GWT: Running Scala Code in a Browser Lex Spoon

Scala Parallel Collections Aleksandar Prokopec

Functional Approach to Distributed Programming with GridGain and Scala Nikita Ivanov

Kafka - A Distributed Publish/Subscribe Messag-ing System Neha Narkhede

Thursday, June 2, 2011 Conference Program

Page 7: June 2‒3, 2011 Stanford University Stanford, Adays2011.scala-lang.org/sites/days2011/files/Scala Days... · 2011-06-02 · Samira Tasharofi, Milos Gligoric, Darko Marinov, and Ralph

Time Lane & Lyons Lodato

June 2 10:25a—12:05p

Scala on Android: Real-world Experience at Bump Technologies Michael Galpin

Pedestrian Scala: Applying Scala to Performance Challenges in the Cable TV Industry Jon Steelman

Scala at Bizo Alex Boisvert

Inhibitions: Reclaiming Exceptions for Better Static Safety in Scala Jon Pretty

StagedSAC - Embedded DSL for Multidimensional Arrays Vlad Ureche

Scala Domain Modeling and Architecture Hossam Karim

June 2 1:45p—3:25p

Spark: Fast, Interactive, Language-Integrated Cluster Computing Matei Zaharia

Scalala: A Scalable Linear Algebra Library Daniel Ramage

Rogue: A Type-safe Query Language for Mon-goDB Jason Liszka, Jorge Ortiz

Remote Function Applications: A Framework to-wards Scala Grid Parallel Collections Nermin Serifovic

Implementing Wadler's Arrow Calculus in Scala Luc Duponcheel

How Scala Experience Improved Our Java Devel-opment Sam Reid

June 2 3:50p—5:30p

Second Time's the Charm: Examining the Anti-XML Framework for Scala Daniel Spiewak, David LaPalomento

Scala Integrated Query - More Expressive Data-base Queries Christopher Vogt

Hammurabi - A Scala Rule Engine Mario Fusco

Scala from a Rubyist Point of View Rémy-Christophe Schermesser

Unit Testing the Implicit Methods that Uses Infra-structure Code Alberto Souza

ScalaU - Implementing a Scala Library for Units of Measure Adrian Fritsch

Thursday, June 2, 2011 Conference Program

Page 8: June 2‒3, 2011 Stanford University Stanford, Adays2011.scala-lang.org/sites/days2011/files/Scala Days... · 2011-06-02 · Samira Tasharofi, Milos Gligoric, Darko Marinov, and Ralph

Time McCaw Hall Barnes, McDowell, & Cranston

June 3 9:00a—10:00a

Keynote: Supporting the Many Flavors of Parallel Programming Doug Lea

June 3 10:25a—12:05p

A Tour of the REPL's :power Mode Paul Phillips

Parallel Distributed Collections API Josh Suereth and Daniel Mahler

Effective Scala Bill Venners and Dick Wall

Project Hydrogen: Building a Distributed Com-pute Platform for Design Engineering with Akka and Scala Garrick Evans

Above the Clouds: Introducing Cloudy Akka Jonas Bonér

The Promising Future of Akka Viktor Klang

June 3 1:45p—3:25p

Lightweight Effect Types for Scala Lukas Rytz

Scala and AspectJ: Approaching Modularization of Crosscutting Functionalities Ramnivas Laddad

Scala.NET: What You Can Do with It Today Miguel Garcia

A Typed, Composable Configuration System for sbt Mark Harrah

The Ease of Scalaz Heiko Seeberger

Node.scala - Implementing Scalable Async IO us-ing Delimited Continuations Tiark Rompf

June 3 3:50p—5:30p

Panel: Scala in the Enterprise: What Will It Take? Moderator: Kunle Olukotun

Friday, June 3, 2011 Conference Program

Page 9: June 2‒3, 2011 Stanford University Stanford, Adays2011.scala-lang.org/sites/days2011/files/Scala Days... · 2011-06-02 · Samira Tasharofi, Milos Gligoric, Darko Marinov, and Ralph

Time Lane & Lyons Lodato

June 3 10:25a—12:05p

Finagle: A Network Stack for the JVM Marius A. Eriksen

Task-Driven Scala Web Applications Timothy Perrett

Play! + Scala: Adding More Fun to the Equation Sadek Drobi, Guillaume Bort

Porting My Own Programming Language Onion's Code from Java to Scala Kota Mizushima

Object Scala Found - a JSR223-compliant Version of the Scala Interpreter Raphael Jolly

Exploring Light-weight Event Sourcing Erik Rozendaal

June 3 1:45p—3:25p

Dependency Injection Strategies in Scala Dick Wall

18 Months With Scala: Building a Driver for MongoDB Brendan W. McAdams

Anorm: Plain Old SQL, Using Scala Collections, Pattern Matching, and Parsers to Simplify an Unnecessarily Over-complexified Task Sadek Drobi

Managing Binary Compatibility in Scala Mirco Dotta

Friday, June 3, 2011 Conference Program

Page 10: June 2‒3, 2011 Stanford University Stanford, Adays2011.scala-lang.org/sites/days2011/files/Scala Days... · 2011-06-02 · Samira Tasharofi, Milos Gligoric, Darko Marinov, and Ralph
Page 11: June 2‒3, 2011 Stanford University Stanford, Adays2011.scala-lang.org/sites/days2011/files/Scala Days... · 2011-06-02 · Samira Tasharofi, Milos Gligoric, Darko Marinov, and Ralph

Thursday, June 2, 2011 Morning Session 9:00 AM — 10:00 AM

McCaw Hall

9:00 AM — 10:00 AM

Keynote

Martin Odersky

State of Scala

Scala is a unique combination of cutting-edge programming language research and down-to-earth practicality. The setup of the ScalaDays conference is a great testimony for that.

In my talk, I will give an outline of recent developments of the language and its ecosystem, and also will introduce some of the projects that are currently underway.

Martin Odersky is a professor at EPFL in Lausanne, Switzerland. He is best known as the creator and principal designer of the Scala programming language. Prior to that, he made several contributions to the develop-ment of Java. He created the Pizza and GJ languages, designed the original version of generics for Java, and wrote the javac reference compiler. He is interested in programing languages and methods, in particular how object-oriented and functional programming can be made to work seamlessly together. Martin Odersky received his doctorate from ETH Zürich, in 1989. He held researcher positions at the IBM T.J. Watson Research Center and Yale university and faculty positions at the University of Karlsruhe from 1993 and at the University of South Australia from 1997. In 1999 he joined EPFL as full professor. He is on the edi-torial board of the Journal of Functional Programming and member of IFIP WG 2.8. He was conference chair for ICFP 2000, and program chair for ECOOP 2004 and ETAPS/CC 2007. He is a fellow of the ACM.

Page 12: June 2‒3, 2011 Stanford University Stanford, Adays2011.scala-lang.org/sites/days2011/files/Scala Days... · 2011-06-02 · Samira Tasharofi, Milos Gligoric, Darko Marinov, and Ralph

Thursday, June 2, 2011 Morning Session 10:25 AM – 12:05 PM

McCaw Hall The Second Scala Workshop

Barnes, McDowell, & Cranston Technical Talks: DSLs for Parallelism

10:25a–10:55a MUTS: Native Scala Constructs for Software Transactional Memory Daniel Goodman, Behram Khan, Salman Khan, Chris Kirkham, Mikel Lujan, and Ian Watson

In this paper we argue that the current approaches to implementing transaction-al memory in Scala, while very clean, adversely affect the programmability, read-ability and maintainability of transactional code. These problems occur out of a desire to avoid making modifications to the Scala compiler. As an alternative we introduce Manchester University Transactions for Scala (MUTS), which instead adds keywords to the Scala compiler to allow for the implementation of transac-tions through traditional block syntax such as that used in ``while'' statements. This allows for transactions that do not require a change of syntax style and do not restrict their granularity to whole classes or methods. While implementing MUTS does require some changes to the compiler's parser, no further changes are required to the compiler. This is achieved by the parser describing the trans-actions in terms of existing constructs of the abstract syntax tree, and the use of Java Agents to rewrite to resulting class files once the compiler has completed.

10:25a–10:55a Liszt: A DSL for Solving Mesh-based PDEs Zach DeVito

Liszt is a domain specific language that exposes a high level interface for mesh-based computation. This frees scientists from architecture-specific implementa-tions and increases programmer productivity. Currently, the state of the art PDE solvers are tied to a specific platform and architecture. Extending these codes with new algorithms or to new hardware is tedious, and the scientist is distract-ed by low level decisions regarding the targeted architecture. Liszt code is port-able across architectures, and provides high level abstractions without sacrific-ing performance by performing domain specific optimizations at compile time. We present our support for explicit and implicit methods supported by built-in mesh and sparse matrix structures, and portability results across SMPs, MPI-based clusters and GPUs.

11:00a–11:30a Setac: A Framework for Phased Deterministic Testing of Scala Actor Programs Samira Tasharofi, Milos Gligoric, Darko Marinov, and Ralph Johnson

Scala provides an actor library where computation entities, called actors, com-municate by exchanging messages. The schedule of message exchanges is in general non-deterministic. Testing non-deterministic programs is hard, because it is necessary to ensure that the system under test has executed all important schedules. Setac is our proposed framework for testing Scala actors that (1) al-lows programmers to specify constraints on schedules and (2) makes it easy to check test assertions that require actors to be in a stable state. Setac requires little change to the program under test and requires no change to the actor run-time system. In sum, Setac aims to make it much simpler to test non-deterministic actor programs in Scala.

11:00a–11:30a Delite: A Framework for Heterogeneous Parallel DSLs Kevin Brown

Computing systems are becoming increasingly parallel and heterogeneous, and therefore new applications must be capable of exploiting parallelism in order to continue achieving high performance. Unfortunately targeting these emerging devices often requires using multiple disparate programming models and mak-ing decisions that can limit forward scalability. Domain-specific languages (DSLs), however, can provide high-level abstractions that enable transfor-mations to high performance parallel code without degrading programmer productivity. We present the Delite Compiler and Runtime environment, an end-to-end system for executing DSL applications on parallel heterogeneous hard-ware. The framework lifts embedded DSL applications to an intermediate repre-sentation (IR), performs general-purpose, parallel, and domain-specific optimi-zations, and generates an execution graph that targets multiple heterogeneous hardware devices.

11:35a–12:05p Parallelizing Machine Learning – Functionally: A Framework and Abstractions for Parallel Graph Processing Philipp Haller and Heather Miller

Implementing machine learning algorithms for large data, such as the Web graph and social networks, is challenging. Even though much research has focused on making sequential algorithms more scalable, their running times continue to be prohibitively long. Meanwhile, parallelization remains a formidable challenge for this class of problems, despite frameworks like MapReduce which hide much of the associated complexity. We present a framework for implementing parallel and distributed machine learning algorithms on large graphs, flexibly, through the use of functional programming abstractions. Our aim is a system that allows researchers and practitioners to quickly and easily implement (and experiment with) their algorithms in a parallel or distributed setting. We introduce functional combinators for the flexible composition of parallel, aggregation, and sequential steps. To the best of our knowledge, our system is the first to avoid inversion of control in a (bulk) synchronous parallel model.

11:35a–12:05p OptiML on Delite: A DSL for Machine Learning Arvind Sujeeth

As the size of datasets continues to grow, machine learning applications are becoming increasingly limited by the amount of available computational power. Taking advantage of modern hardware requires using multiple parallel pro-gramming models targeted at different devices (e.g. CPUs and GPUs). However, programming these devices to run efficiently and correctly is difficult, error-prone, and results in software that is harder to read and maintain. We present OptiML, a domain-specific language (DSL) for machine learning. OptiML is an implicitly parallel, expressive and high performance alternative to MATLAB and C++. OptiML performs domain-specific analyses and optimizations and auto-matically generates CUDA code for GPUs. We show that OptiML outperforms explicitly parallelized MATLAB code in nearly all cases.

Page 13: June 2‒3, 2011 Stanford University Stanford, Adays2011.scala-lang.org/sites/days2011/files/Scala Days... · 2011-06-02 · Samira Tasharofi, Milos Gligoric, Darko Marinov, and Ralph

Thursday, June 2, 2011 Morning Session 10:25 AM – 12:05 PM

Lane & Lyons Technical Talks

Lodato Technical Talks

10:25a–10:55a Scala on Android: Real-world Experience at Bump Technologies Michael Galpin

You might not have known that Bump, one of the most popular Android applica-tions on the Market, was built using Scala. The were many factors in deciding to use Scala for Bump, and there have certainly been some tradeoffs. This talk will focus on these factors and tradeoffs, as well as a few lessons and tricks learned along the way.

10:25a–10:55a Inhibitions: Reclaiming Exceptions for Better Static Safety in Scala Jon Pretty

Java provides an exception-handling mechanism to allow certain events to interrupt the normal program flow. Whilst Scala retains this feature from Java, the constraint of requiring the programmer to either handle or declare all checked exceptions is not carried across. This has changed how exceptions are used in Scala, to the extent that some coding styles discourage the use of ex-ceptions entirely. This talk describes an alternative approach to exception checking, nominally called inhibitions, which invert the logic on Java's exception declarations by permitting the programmer to declare methods as never throw-ing the type of exception specified, and having the compiler check this.

11:00a–11:30a Pedestrian Scala: Applying Scala to Performance Challenges in the Cable TV Industry Jon Steelman

Real-world performance challenges in the Cable TV Industry with Interactive Advertisingmoving Significant Data Volume. Given highly inadequate processing performance with a legacy JVM technology stack, would the scalability/performance promise and faster develop promise of Scala hold true even for a team new to Scala and under deadlines? Our team attempt at incremental performance improvements with the legacy JVM stack was making minimal progress. We will share our experience assessing and trialing Scala in a practical business application for the Cable TV Industry where we went from an XML processing spike solution that ultimately let to a full production solution. Technical benefits as well as business benefits of Scala adoption will be discussed. Our experience can provide some insight into the applicability of Scala to a broader range of pedestrian IT applications that are typically developed in Java or Groovy.

11:00a–11:30a StagedSAC - Embedded DSL for Multidimensional Arrays Vlad Ureche

StagedSAC is an embedded DSL for operations on multidimensional arrays. The language is modeled after Single Assignment C and is embedded in Scala using the Lightweight Modular Staging framework. The main challenge encountered was the need to have a further type inference stage inside the embedded lan-guage, which cannot be offset to the Scala type inferencer, and is now done as an optimization pass. This talk will describe the concept of multidimensional arrays, the Single Assignment C language, how the need for a further type infer-ence stage arose and how this was implemented in the Lightweight Modular Staging framework.

11:35a–12:05p Scala at Bizo Alex Boisvert

Bizo is high-tech startup company that progressively adopted Scala starting in the late 2009. This presentation will report on our experience using and deploying Scala within our internet marketing platform. I'll review the small and not-so-small steps we took during our adoption, how we integrated Scala with our build and cloud deployment system, discuss interopera-bility and layering with existing internal and 3rd-party Java libraries and illustrate the convenience, expressiveness and performance afforded by Scala in various parts of our web analytics platform. In particular, we'll demonstrate a scalable -- so-called NoSQL or Big Data -- multi-dimensional database backend built with Scala and designed to run on the Ama-zon Web Services cloud infrastructure (EC2, S3, ...). he presentation is intended for individuals and companies considering or already in the process of adopting Scala. As part of the presentation, I'll share a few chal-lenges our team faced during our adoption and how we dealt with them.

11:35a–12:05p Scala Domain Modeling and Architecture Hossam Karim

We present how we introduced Scala to our clients as the main programming language to implement an OSGi based micro-kernel service container. We dis-cuss the technology stack and architectural approaches including:

A Scala implementation of OMG’s Model-Driven Architecture Query/

View/Transformation pattern

How Scala functional features helped implementing Enterprise Integration

Patterns and working with Graph databases

How Scala object-oriented features helped growing distinct hierarchies

independently and promoted loose coupling

How we utilized Scala language constructs to introduce meta-modeling

and Domain-Specific Languages

Page 14: June 2‒3, 2011 Stanford University Stanford, Adays2011.scala-lang.org/sites/days2011/files/Scala Days... · 2011-06-02 · Samira Tasharofi, Milos Gligoric, Darko Marinov, and Ralph

Thursday, June 2, 2011 Afternoon Session 1:45 PM – 3:25 PM

McCaw Hall The Second Scala Workshop

Barnes, McDowell, & Cranston Technical Talks: IDEs

1:45p–2:15p Scala.react: Embedded Reactive Programming in Scala Ingo Maier

In contrast to batch processing systems, interactive systems require substantial programming effort to continuously synchronize with their environment. We quickly review existing programming systems that address this task. We present scala.react, our approach to embedded reactive programming in Scala which combines many advantages of previous systems. We show how our implementa-tion makes use of dynamic dataflow graphs, delimited continuations and implicit parameters in order to achieve certain semantic guarantees and concise syntax.

1:45p–2:15p ENSIME: The ENhanced Scala Interaction Mode for Emacs Aemon Cannon

ENSIME is a new Scala environment for Emacs. It provides many common IDE features, such as live error-checking, symbol inspection, package/type brows-ing, and automated refactoring. This talk will give an overview of ENSIME's features and discuss aspects of its design, especially the client/server architec-ture and points of integration with the Scala Compiler.

2:20p–2:50p Checking Flight Rules with TraceContract - Application of a Scala DSL for Trace Analysis Howard Barringer, Klaus Havelund, Elif Kurklu, and Robert Morris

Typically during the design and development of a NASA space mission, rules and constraints are identified to help reduce reasons for failure during operations. These flight rules are usually captured in a set of indexed tables, containing rule descriptions, rationales for the rules, and other information. Flight rules can be part of manual operations procedures carried out by humans. However, they can also be automated, and either implemented as on-board monitors, or as ground based monitors, part of a ground data system. In the case of automated flight rules, one considerable expense to be addressed for any mission is the extensive process by which system engineers express flight rules in prose, software devel-opers translate these requirements into code, and then both experts verify that the resulting application is correct. This paper explores the potential benefits of using an internal Scala DSL (Domain Specific Language) to write executable speci-fications of flight rules.

2:20p–2:50p The Scala IDE for Eclipse Reloaded Iulian Dragos

In this talk I will present the new architecture of the presentation compiler and how the Eclipse IDE is using it to deliver a reliable, responsive Scala environ-ment. Moving from a text editor to a modern IDE requires tools that understand the source code. Most semantic actions, like content assist (code completion) or 'jump to definition' require full type-checking. The Scala type system is one of the most advanced type systems in use today, and the reference type checker implementation is roughly 15kLOC of Scala code. Rewriting that for an IDE would be a very tedious and error-prone task. Instead, we decided to use the existing Scala compiler, with the added benefit that it will always be up to date with the spec. Type-checking is the single most time-consuming task in the compiler, therefore type-checking files at every keystroke was immediately ruled out. The result is an asynchronous, interruptible, targeted type-checker that can be asked to perform actions like retrieve type members at a given position, or find the defi-nition of a given symbol.

2:55p–3:25p Lafros MaCS Programmable Devices: Case Study in Type-safe API Design using Scala Rob Dickens

Lafros MaCS is an experimental Scala API for building distributed monitoring and control systems, and features reusable software modules known as Programma-ble Devices (PDs). Each such module provides a type-safe API for doing such things as registering a device-interface instance or writing a program to control the device. After introducing PDs, an explanation of how this type-safety is achieved, starting from the simplest of examples, then describing how various language features which Scala has to offer can play a part, will be followed by one of how the present framework was arrived at, to conclude.

2:55p–3:25p Type Debugger Hubert Plociniczak

The type inference that exists in advanced programming languages like Scala or Haskell allows for a reduction on the number of user-provided types making the code often easier to read and understand. Unfortunately it is not always possi-ble to get rid of them for more complicated constructs and it might be hard to explain to the programmer the reasons for these limitations. Error messages also tend to become more cryptic, especially for beginner programmers, bring-ing disappointment and eventually increasing shift towards popularity of dy-namically typed languages. We believe that making a language more powerful and adding increasing ad-vanced features has to come in parallel with ways of easing their understanding for programmers. The aim of our project is to explain the working of this typechecking “black box” in an accessible way. We abstract the work of the typechecker to a high-level representation which can be later manipulated, annotated with even more information, and shown to the user through visuali-zations. For instance, one of the most desired extensions for the type debugger would involve the possibility of showing implicit arguments and conversions at any given typechecking step.

Page 15: June 2‒3, 2011 Stanford University Stanford, Adays2011.scala-lang.org/sites/days2011/files/Scala Days... · 2011-06-02 · Samira Tasharofi, Milos Gligoric, Darko Marinov, and Ralph

Thursday, June 2, 2011 Afternoon Session 1:45 PM – 3:25 PM

Lane & Lyons Technical Talks

Lodato Technical Talks

1:45p–2:15p Spark: Fast, Interactive, Language-Integrated Cluster Computing Matei Zaharia

Spark is an open source cluster computing framework that aims to both general-ize the data flow programming model of MapReduce and make applications easier to write through a language-intergated Scala API. Spark provides fault-tolerant "distributed datasets" that can be manipulated through parallel opera-tors like map, reduce, filter, and join, much like local collections, and can also be cached in memory on the cluster for future reuse. The ability to cache datasets makes Spark especially efficient for iterative applications, like machine learning and graph algorithms, where it can outperform Hadoop by 20x. Finally, we modi-fied the Scala interpreter to make it possible to run Spark interactively to load big datasets into memory and query them, providing substantially lower latencies than Hadoop-based tools. We plan to demo this use case. Spark is being used by machine learning researchers at Berkeley and engineers at Conviva to run in-memory analytics on hundreds of gigabytes of data.

1:45p–2:15p Remote Function Applications: A Framework towards Scala Grid Parallel Collections Nermin Serifovic

If we want to get some piece of functionality executed on another server we typically think of remote actors. However, even though actor model might be good fit for solving concurrency problems, it is not necessarily the best weapon for attacking parallelism. One example are computationally intensive pure func-tions, which are stateless by their nature. Once there is a framework in place for efficiently applying functions on remote computers and also composing them, the next question becomes: what does it take to bring Scala Parallel Collections to the next level? That is, how would it look like if we wanted to distribute processing collection operations across a compute grid? The goal of this talk is to present such framework and the API for grid-parallel versions of several collection operations which involve function application (ex. map, flatMap, filter). Furthermore, it will show a use case application built on this framework solving a more compute than data intensive problem.

2:20p–2:50p Scalala: A Scalable Linear Algebra Library Daniel Ramage

Numerical programming environments such as Matlab and R express linear alge-bra as simple expressions involving matrices and vectors. However, general pur-pose programming with richer data structures ranges from slow to painful. Ideal-ly, a programmer shouldn't have to choose between the convenience of a lan-guage designed for linear algebra and the performance of a general purpose programming language. In this talk, I will introduce Scalala, a numerical linear algebra library for Scala. Scalala supports rich Matlab-like operators on vectors and matrices and a library of numerical and plotting routines. By borrowing from and extending the design of the Scala 2.8 collections, Scala's built-in matrix and vector types allow for linear algebra to be expressed succinctly and executed efficiently. The library also enriches Scala's collection types with similar opera-tors, allowing for mathematical operations on (nested) numerically valued collec-tions. I will present an overview of the design and implementation of Scalala and demonstrate how Scala's implicits can be used to drop in highly optimized code-paths in a statically type-safe way. This enables Scalala to provide high perfor-mance, statically type-safe linear algebra directly in Scala. When combined with the Scala interpreter, Scalala is an able interactive data analysis platform.

2:20p–2:50p Implementing Wadler's Arrow Calculus in Scala Luc Duponcheel This technical talk is about a case study to experiment with the expressive pow-er of Scala. Although I'm aware of the existence of libraries that deal with mon-ads and related stuff, I wanted to approach their implementation form another point of view: less Haskell-like and more Scala-like. Recently I discovered the paper "The Arrow Calculus", and I felt challenged to implement the ideas of the paper in Scala. The result turned out, among others, to be an interesting case study for the usage of:

traits and objects as modules

variance

implicits

scala-test and scala-check

2:55p–3:25p Rogue: A Type-safe Query Language for MongoDB Jason Liszka and Jorge Ortiz

We present Rogue, a type-safe query language for MongoDB written in Scala. MongoDB is a NoSQL datastore for schema-less, JSON-like documents which supports a very rich query language. Even though MongoDB is schema-less, we use Lift's Record and Field libraries to define a typed schema for our Mongo col-lections, which enforces type safety for any code reading or writing from those collections. Rogue builds on top of Record and allows for type-safe creation of Mongo queries. By exploiting the type information present in the Record schema, Rogue protects at compile time against using operators on fields where they don't make sense. In addition, Rogue uses phantom types to ensure that certain modifiers for a query (e.g., skip, limit) aren't applied twice or in contradictory ways. We will discuss our experience using Rogue with a team of several dozen engineers at foursquare. Rogue has made our database query code more concise, easier to understand, and eliminated entire classes of bugs from it. Finally, we discuss possible future directions for Rogue: compile time guarantees that que-ries make indexed lookups, and generating more complex MapReduce queries.

2:55p–3:25p How Scala Experience Improved Our Java Development Sam Reid

PhET Interactive Simulations at the University of Colorado creates free, open-source educational simulations. After developing several simulations in Scala, we identified several advantageous techniques and patterns in Scala which we were able to transfer to subsequent Java development projects. Specifically, our experience with Scala helped us attain the following advantages in our Java development: improved object initialization, improved code organization, re-duced code duplication and improved management of boilerplate code. These effect of these changes has been to make our code easier to write, read and maintain. These ideas are not specific to our application domain, but should work equally well in broad range of domains. We also discuss how adoption of these Scala-like patterns in Java code can simplify the learning curve for Java developers who want to learn Scala.

Page 16: June 2‒3, 2011 Stanford University Stanford, Adays2011.scala-lang.org/sites/days2011/files/Scala Days... · 2011-06-02 · Samira Tasharofi, Milos Gligoric, Darko Marinov, and Ralph

Thursday, June 2, 2011 Afternoon Session 3:50 PM – 5:30 PM

McCaw Hall The Second Scala Workshop

Barnes, McDowell, & Cranston Technical Talks

3:50p–4:20p Loop Recognition in C++/Java/Go/Scala Robert Hundt and Tipp Moseley

In this experience report we encode a well specified, compact benchmark in four programming languages, namely C++, Java, Go, and Scala. The implementations each use the languages’ idiomatic container classes, looping constructs, and memory/object allocation schemes. It does not attempt to exploit specific lan-guage and runtime features to achieve maximum performance. This approach allows an almost fair comparison of language features, code complexity, compil-ers and compile time, binary sizes, runtimes, and memory footprint. While the benchmark itself is simple and compact, it employs many language features, in particular, higher-level data structures (lists, maps, lists and arrays of sets and lists), a few algorithms (union/find, dfs / deep recursion, and loop recognition based on Tarjan), iterations over collection types, some object oriented features, and interesting memory allocation patterns. We do not explore any aspects of multi-threading, or higher level type mechanisms, which vary greatly between the languages. The benchmark points to very large differences in all examined dimensions of the language implementations. After publication of the benchmark internally at Google, several engineers produced highly optimized versions of the benchmark. While this whole effort is an anectodal comparison only, the bench-mark and subsequent tuning effort might be indicatie of typical performance pain points in the respective languages.

3:50p–4:20p Scala Parallel Collections Aleksandar Prokopec

Parallel programming abstractions become increasingly important as the num-ber of processor cores grows. A high-level programming model enables the programmer to focus more on the program and less on low-level details such as synchronization and load-balancing. Scala parallel collections extend the pro-gramming model of the Scala collection framework, providing parallel opera-tions on datasets. The talk will describe the architecture of the parallel collection framework, explaining their implementation and design decisions. Concrete collection im-plementations such as parallel hash maps and parallel hash tries will be de-scribed. Finally, several example applications will be shown, demonstrating the programming model in practice.

4:25p–4:55p Compiling Scala to LLVM Geoffrey Reedy

This paper describes ongoing work to implement a new backend for the Scala compiler that targets the Low Level Virtual Machine (LLVM). LLVM aims to pro-vide a universal intermediate representation for compilers to target and a frame-work for program transformations and analyses. LLVM also provides facilities for ahead-of-time and just-in-time native code generation. Targeting LLVM allows us to take advantage of this framework to compile Scala source code to optimized native executables. We discuss the design and implementation of our backend. We also outline the additional work needed to produce a robust backend.

4:25p–4:55p Functional Approach to Distributed Programming with GridGain and Scala Nikita Ivanov

The topic of this presentation is about using Scala with GridGain framework to provide a simple and productive development platform for high performance distributed applications. 2/3 of the presentation will be devoted to live coding demonstration of writing basic MapReduce application in Scala DSL based on GridGain distributed runtime. All coding during demonstration will be done live. Overview of grid and cloud computing concepts will be discussed.

5:00p–5:30p Scala+GWT: Running Scala Code in a Browser Lex Spoon

The Scala+GWT project is working to compile Scala code for running in a standard web browser. It uses the Google Web Toolkit (GWT) for the heavy lifting, and a new format called Jribble as an intermediate format that both Scala and GWT understand. In addition to letting you share code between the server and the client, this approach gives access to the substantial capabilities of GWT, such as code splitting, image spriting, CSS optimization, and templated UIs. In this talk I will describe the advantages of the approach, the main technical challenges, and the current status.

5:00p–5:30p Kafka - A Distributed Publish/Subscribe Messaging System Neha Narkhede

Kafka is a distributed publish/subscribe messaging system aimed at providing a scalable, high-throughput solution for log aggregation and processing of all activity stream data on a consumer-scale website. Built on Apache Zookeeper using Scala, Kafka aims at unifying offline and online data processing by provid-ing a mechanism for parallel data load into Hadoop as well as the ability to partition real-time consumption over a cluster of machines. Written by the Search, Network and Analytics team at LinkedIn, Kafka is open sourced under the Apache License. In this presentation, we will discuss some of the production applications of Kafka at LinkedIn. We will highlight the core design principles of Kafka and how those make it a good fit for both real time applications as well as offline analytical processing. Finally, we will briefly take a look at the perfor-mance metrics and future directions.

Page 17: June 2‒3, 2011 Stanford University Stanford, Adays2011.scala-lang.org/sites/days2011/files/Scala Days... · 2011-06-02 · Samira Tasharofi, Milos Gligoric, Darko Marinov, and Ralph

Thursday, June 2, 2011 Afternoon Session 3:50 PM – 5:30 PM

Lane & Lyons Technical Talks

Lodato Technical Talks

3:50p–4:20p Second Time's the Charm: Examining the Anti-XML Framework for Scala Daniel Spiewak and David LaPalomento

The scala.xml framework bundled with the standard library has a lot of long-standing issues. Anti-XML is a clean room effort to replace this framework with something safer, more convenient and more performant. This talk will cover the design decisions that went into Anti-XML (providing some theoretical justification for a few of the more contentious ones). We will examine the general architec-ture of Anti-XML from a framework standpoint, the end-user API and perfor-mance with a particular emphasis on the areas in which Anti-XML exceeds the capabilities of scala.xml. Once we have the high-level overview out of the way, we will engage in some live-coding to demonstrate the framework in action.

3:50p–4:20p Scala from a Rubyist Point of View Rémy-Christophe Schermesser

Once upon a time, there was a language called Java. It was the state of the art to build Web applications - well there was nothing else. But it pained develop-ers to use it, because it was too cumbersome, too heavy... Then some developers decided to rebel and stab Java in the back by using other languages. One of these languages was Ruby. On top of it they built several web frameworks that were easy to use, and battling with web applications became fun again! But Ruby was not alone. Other languages were there and wanted to have their own bunch of coders. In the dark Scala was waiting and growing... It had a lot of fine weapons to attract coders, and so coders came. Now, on the raging battlefield of web development who will win: Ruby or Scala? This talk will focus on comparing the two languages from a developer point of view, the easiness to test it, to efficiently produce code with it.

4:25p–4:55p Scala Integrated Query - More Expressive Database Queries Christopher Vogt

Scala Integrated Query is a database query DSL prototype developed at LAMP, EPFL. It allows a subset of Scala to be executed in the DBMS. Compared to using SQL for database queries, it can lead to more accurate code and makes it easier to achieve good performance for complex queries. Scala Integrated Query fea-tures greater expressiveness, type safety, familiar syntax and easy composability. Queries can result in arbitrarily nested lists and tuples. Complex queries are effi-ciently mapped to SQL queries and automatically optimized. Avalanches of SQL queries are prevented, in particular when correlating data in main-memory with data in the database. This prototype was developed in a Master's project and builds up on research and software of University of Tübingen, namely Ferry and Pathfinder. A production-ready library is planned to be available sometime next year.

4:25p–4:55p Unit Testing the Implicit Methods that Uses Infrastructure Code Alberto Souza

Implicit method is one of the most used features of scala. But sometimes, when you want to test it, especially if it has some logic that needs infrastructure, like acessing a database, the setup can be hard. In this talk, it will be presented a situation, that we need to test our code that uses implicit method, but instead of use the implicit that is used for production code, we will use a mocked ver-sion of it for create our unit tests.

5:00p–5:30p Hammurabi - A Scala Rule Engine Mario Fusco

One of the most common reason why software projects fail, or suffer unbearable delays, is the misunderstandings between business analysts and developers. Indeed the latter write the business rules in a language that is completely ob-scure for the first ones and in this way the business analysts don't have a chance to read, understand and validate what the programmers developed. They can only empirically test the final software behavior, hardly covering all the possible corner cases and recognizing mistakes only when it is too late. Hammurabi is an actor-based rule engine written in Scala that leverages the language's features making it particularly suitable to implement extremely reada-ble internal DSL. What makes Hammurabi different from all other rule engines is that, despite its rules are written directly in the host language, they are also easi-ly understandable even by non technical persons.

5:00p–5:30p ScalaU - Implementing a Scala Library for Units of Measure Adrian Fritsch

Units of Measure libraries or language extensions are available in some pro-gramming languages. Most of them, however, focus primarily on unit conver-sion, and few support compile-time dimensional analysis. We present the chal-lenges in implementing Units of Measure support in general, and briefly present the features supported in other languages. We show how Scala, with its power-ful type system, is a language well suited for implementing support for Units of Measure. A few possible Scala implementations are briefly described, with pros and cons. We then present ScalaU, a pragmatic, type-safe Scala library sup-porting seamless unit conversion, as well as customizable, compile-time dimen-sional analysis and unit inference. We show that, just as a strong type system can go a long way in proving program correctness, a strong units library can go a long way in proving correctness of scientific calculations.

Page 18: June 2‒3, 2011 Stanford University Stanford, Adays2011.scala-lang.org/sites/days2011/files/Scala Days... · 2011-06-02 · Samira Tasharofi, Milos Gligoric, Darko Marinov, and Ralph
Page 19: June 2‒3, 2011 Stanford University Stanford, Adays2011.scala-lang.org/sites/days2011/files/Scala Days... · 2011-06-02 · Samira Tasharofi, Milos Gligoric, Darko Marinov, and Ralph

Friday, June 3, 2011 Morning Session 9:00 AM — 10:00 AM

McCaw Hall

9:00 AM — 10:00 AM

Keynote

Doug Lea

Supporting the Many Flavors of Parallel Programming

Functional programming is mostly about evaluating (possibly parallelizable) expressions. Object-oriented programming is mostly about passing messages among (possibly autonomous) objects. These, and other familiar programming models do not transparently map to common platforms. This talk describes some of the ideas involved in supporting them, along with intermediary forms that come into play in effective concurrent programming.

Doug Lea is a professor of Computer Science at the State University of New York at Oswego. He is author of the book "Concurrent Programming in Java", co-author of "Object-Oriented System Development" and "Java Concurrency in Practice", and primary author of several widely used software packages and components, as well as articles, reports, and standardization efforts dealing with object oriented software development in-cluding those on specification, design and implementation techniques, distributed, concurrent, and parallel object systems, and software reusability. He has served as chair, organizer, or program committee member for over 100 conferences or workshops in these areas.

Page 20: June 2‒3, 2011 Stanford University Stanford, Adays2011.scala-lang.org/sites/days2011/files/Scala Days... · 2011-06-02 · Samira Tasharofi, Milos Gligoric, Darko Marinov, and Ralph

Friday, June 3, 2011 Morning Session 10:25 AM – 12:05 PM

McCaw Hall Technical Talks

Barnes, McDowell, & Cranston Technical Talks: Akka

10:25a–10:55a A Tour of the REPL's :power Mode Paul Phillips

Speaker is primarily responsible for the current state of the scala repl, unfortu-nately including the largely non-existent documentation of some of its most appealing features. I propose to take a step toward remedying that with a tour of what is possible, and then to field questions about the repl or any other aspect of the compiler and library.

10:25a–10:55a Project Hydrogen: Building a Distributed Compute Platform for Design Engineering with Akka and Scala Garrick Evans

I will be presenting an overview of the first year development of a new platform within my emerging technology group. This experience report will hopefully provide insights into using Scala and Akka within a commercial organization and production deployment. I intend to outline both benefits and challenges that I encountered during this phase of project and make an argument in support of participation in open source community.

11:00a–11:30a Parallel Distributed Collections API Josh Suereth and Daniel Mahler

This talk outlines the construction of a Parallel Distributed Collections API (Cascade) and outlines the challenges associated with developing a Scala API over the existing Java solution (Flume). The details of the JavaFlume library are dis-cussed, including the relevant parallel collections abstractions and the parallel operations allowed against these collections. The current implementation of JavaFlume works with distributed sharded files and Google's BigTable. The optimisation engine for Flume is its defining feature. High level operations like sort, map, reduce and join can be reduced into a series of map-reductions and executed against a cluster of machines. This allows users of the library to develop complex parallel operations in peicemeal fashion and construct a pipe-line of data processing. Cascade is a Scala built on top of Flume to take advantage of its functional na-ture. Challenges in developing Cascade and practical solutions will be examined in depth. Cascade presents a new way of performing Map Reduce operations that is innovate and elegant.

11:00a–11:30a Above the Clouds: Introducing Cloudy Akka Jonas Bonér

We believe that one should never have to choose between productivity and scalability, which has been the case with traditional approaches to concurrency and distribution. The cause of that has been the wrong tools and the wrong layer of abstraction — and Akka is here to change that. Akka is using the Actors together with Software Transactional Memory (STM) to create a unified runtime and programming model for scaling both UP (utilizing multi-core pro-cessors) and OUT (utilizing the grid/cloud). Cloudy Akka, an extension to Akka, provides location and network transparency by abstracting away both these tangents of scalability by turning them into an operations and configuration task. This gives the Cloudy Akka runtime freedom to do adaptive automatic load-balancing, cluster rebalancing, replication, fail-over and partitioning. In this talk you will learn what Cloudy Akka is, how it is implemented and how it can be used to solve hard scalability problems.

11:35a–12:05p Effective Scala Bill Venners and Dick Wall

Scala is a powerful, modern language with many features--so much good stuff, in fact, it can be sometimes hard to figure out what to do with it all. In this talk, Bill Venners and Dick Wall will walk you though some guidelines for the effective use of Scala's features. Half the talk will focus on coding-level practices, and the other half on library and DSL design guidelines.

11:35a–12:05p The Promising Future of Akka Viktor Klang

In this talk we will explore Akkas Future-construct, and how it relates to Promis-es and Dataflow variables. We will talk about how one can use Akkas Futures to build completely non-blocking parallell computations, data transformation and map-reduce solutions using very simple building blocks, for powerful, elegant concurrency that scales from small to large.

Page 21: June 2‒3, 2011 Stanford University Stanford, Adays2011.scala-lang.org/sites/days2011/files/Scala Days... · 2011-06-02 · Samira Tasharofi, Milos Gligoric, Darko Marinov, and Ralph

Friday, June 3, 2011 Morning Session 10:25 AM – 12:05 PM

Lane & Lyons Technical Talks

Lodato Technical Talks

10:25a–10:55a Finagle: A Network Stack for the JVM Marius A. Eriksen We share our experience building and deploying Finagle, a library for building robust and highly performant asynchronous RPC servers and clients. Finagle is built on top of Netty and uses futures as a unifying abstraction in order to provide an intuitive and powerful API on top of asynchronous dispatching. Finagle supports a variety of RPC styles, including request-response, streaming, and pipelining. It is protocol agnostic, and we have implemented codecs for the core protocols at Twitter. We will talk about the design & technical underpinnings of Finagle, the use of futures and channels, integration with Java projects, its use at Twitter, and devel-oper experience.

10:25a–10:55a Porting My Own Programming Language Onion's Code from Java to Scala Kota Mizushima I would like to talk about experiences achieved by porting my own program-ming language Onion's code from Java to Scala and problems encountered in the porting work. I started to develop my own programming language Onion from 2005. Onion's codes were originally written in Java and LoC was about 10000. Onion's code was ugly and its maintainability was bad because I was immature when I began to wrote Onion's code and Java is unfitted for compil-ers. Although the porting work has not completely finished, many codes were already ported except parser's code (generated by JavaCC) and code genera-tor's code (using Apache BCEL). Onion is statically typed and object oriented programming language. Onion supports following features: Object Oriented, Declaration by Assignment, Delegation, Statically Typed, Control Statements like Java, and First-class Functions.

11:00a–11:30a Task-Driven Scala Web Applications Timothy Perrett

Within this talk we will discuss patterns for building interactive, scalable web ap-plications by leveraging some of the best projects available in the Scala communi-ty. Recent years have seen a distinct shift in user behavior online: applications now have to deal with heavily write-orientated, event-driven architectures (E.D.A) and real-time user interfaces. Couple this with the operational challenges of scal-ing these types of applications and one can quickly find themselves having to cope with a lot of additional complexity. This talk guides you through some of the paradigms associated with E.D.A and Task-based User Interfaces, whilst discussing how the Scala eco-system has evolved over the past years, yielding many excellent projects such as Akka and Lift. Utilizing parts of each can make building these highly event-driven, interactive applications far easier than it would otherwise be with more traditional software stacks. More broadly, within this talk you will hear how you can neatly integrate a highly interactive, task-based user experience powered by Lift and propagate user events through entire software architectures, with a robust, distributed backend provided by Akka.

11:00a–11:30a Object Scala Found - a JSR223-compliant Version of the Scala Interpreter Raphael Jolly

In this talk, we aim to describe the challenges of making Scala a JSR 223 com-pliant language, and present a solution in the form of a modified Scala inter-preter. We identify three main reasons for why JSR 223 support does not yet exist: (1) the lack of type information when passing objects past the Java/script boundary, (2) caching of precompiled scripts, and (3) providing a class path to the Scala compiler. We explain why we think issue (1) is not a problem and why existing solutions are imperfect (they require some enclosing script ceremony). Then we describe our solution to problem (2) through a guided tour of the needed source code additions. We focus on the last issue (3) as being the main impediment to the development of a real implementation. The solution presented is to provide the compiler with the appropriate list of avail-able class files through JARs' manifest files.

11:35a–12:05p Play! + Scala: Adding More Fun to the Equation Sadek Drobi, Guillaume Bort

Play! framework is a simple lightweight web framework that has originally been designed for Java programming language on top of the JVM. Its uniqueness on the JVM is in how simple, productive and scalable it is yet being isomorphic to the HTTP protocol. Play! Scala targets the Scala language keeping key properties of the framework. It uses a more functional and Scala idiomatic style of programming without giving up on simplicity and developer friendliness. In this talk we will do a quick introduction into Play! Scala and highlight key com-ponents of the framework and main design techniques that will enable you being productive getting your scalable web application up and running.

11:35a–12:05p Exploring Light-weight Event Sourcing Erik Rozendaal Currently many business applications are developed using a very database centric approach, often requiring the use of complex and heavy-weight Object-Relational Mappers (ORMs) to make developers productive. In this talk we'll explore the use of an alternative approach using the techniques pioneered by Domain-Driven Design (DDD) and especially Command-Query Responsibility Segregation (CQRS): Event Sourcing. Using Event Sourcing the application can be split into two parts: Domain logic responsible for generating events (command side); Reporting, view, integration, etc. logic that consumes the generated events ("query" side).

Through this explicit notion of change (domain events) the developer is put back in control of the application. Traditional languages such as Java require a lot of ceremony when implementing event sourcing, obscuring the basic sim-plicity. Using Scala's flexible syntax and support for light-weight classes, immu-table data structures and transactional memory only very little support code is needed to build production ready applications using Event Sourcing. We can start simple and scale up to more complexity only when needed. During this talk we'll take a quick tour through the code you need to get started.

Page 22: June 2‒3, 2011 Stanford University Stanford, Adays2011.scala-lang.org/sites/days2011/files/Scala Days... · 2011-06-02 · Samira Tasharofi, Milos Gligoric, Darko Marinov, and Ralph

Friday, June 3, 2011 Afternoon Session 1:45 PM – 3:25 PM

McCaw Hall Technical Talks

Barnes, McDowell, & Cranston Technical Talks

1:45p–2:15p Lightweight Effect Types for Scala Lukas Rytz

In addition to returning a result, methods in Scala can perform side-effects such as modifying state, throwing exceptions or performing I/O. These side-effects are an important part of a methods semantics, however they are not described in its signature. Knowing the side-effects of methods is not only useful as a documentation for programmers, but it is becoming increasingly important for new tools and librar-ies. Examples are found concurrent programming, the new parallel collections, DSLs or transactional memory implementations: such libraries often assume purity or limited side-effects of certain parts of the code without being able to verify it. We are working on an extension to Scala's type system for tracking and verifying different kinds of side-effects. The main goal is to implement a system that is powerful enough to give precise and useful information, while keeping the anno-tation overhead as small as possible. I will present the main ideas and demon-strate a prototype implementation for tracking potentially thrown exceptions (similar to `throws` in Java, but more polymorphic) and for verifying purity with respect to state modifications.

1:45p–2:15p A Typed, Composable Configuration System for sbt Mark Harrah

sbt is a build tool written in Scala and configured in Scala. One goal of sbt is to provide a default build by convention, while being extensively configurable. Transitioning from convention to customization should be smooth, so that only the unique aspects of the build need to be defined. Towards this goal, sbt 0.9 introduces a new typed, composable configuration system. Important elements of the new system include first class overriding and scoping of settings and delegating settings to other scopes. First class settings allow relationships between settings, such as building up paths or defining task in-puts, to be declared once and used in different contexts with minimal effort. Scoping and delegation enable configuration at the granularity of the whole build, a project, a configuration, or a single task. The new task system integrates with this configuration system to uniformly define the execution and configura-tion graphs of a build.

2:20p–2:50p Scala and AspectJ: Approaching Modularization of Crosscutting Functionalities Ramnivas Laddad

Modularizing crosscutting functionalities such as caching, transaction manage-ment, security, and auditing is a difficult problem. When not dealt with correctly, they lead to duplicated, unmaintainable, and often plain-wrong implementation. Aspect-oriented programming (AOP) allows modularizing such functionalities through aspects. Functional programming in Scala, too, offers a way to do the same through higher-order functions. Instead of mixing code from crosscutting functionalities with business logic, developer can use higher-order functions to separate them. In many cases, using higher-order functions can yield cleaner solution than equivalent AOP solution. In other cases, it is the opposite. In any case, there is a synergy between the two. In this talk, we will examine common crosscutting concerns in enterprise applica-tions. We will compare AOP implementation based on AspectJ and functional implementation based on Scala. The comparison is interesting in that both run on JVM and both are statically typed. Through examples, we will show how these two approaches fare and how to use them together beneficially.

2:20p–2:50p The Ease of Scalaz Heiko Seeberger

While looking at the implementation of Scalaz carries the risk of blowing up you brains, this library offers an abundance of low-hanging fruit. In this talk we will take a look at some of the most tasteful and really easy to use Scalaz features. For example we will see how to avoid the pitfall of Scala’s not-typesafe equals-operator, how to get rid of inscrutable validation logic or how to compose Akka actors and futures. Don’t be afraid: We will focus on using Scalaz, understand-ing the internals is not required.

2:55p–3:25p Scala.NET: What You Can Do with It Today Miguel Garcia

After some time in the making, Scala.NET is now in the game to gain developer mindshare. This talk covers the value proposition of the compiler, progressively working our way from console applications to targeting .NET in its different fla-vors, in particular the Compact Framework for mobile development. This part of the talk also reviews current Visual Studio support (including debugging and “metadata as source”) as well as work in progress in this area. Finally, we report our experience in automating the migration of Scala sources from JDK to .NET with the help of jdk2ikvm, a tool we developed to bootstrap the compiler on .NET, all while maintaining a single code base.

2:55p–3:25p Node.scala - Implementing Scalable Async IO using Delimited Continuations Tiark Rompf

Asynchronous IO is an important ingredient for scalable software systems. In this talk we will take a look at the popular JavaScript-based Node.js framework and present a (minimalistic) port to idiomatic Scala. We will make heavy use of delimited continuations to remove inversion of control.

Page 23: June 2‒3, 2011 Stanford University Stanford, Adays2011.scala-lang.org/sites/days2011/files/Scala Days... · 2011-06-02 · Samira Tasharofi, Milos Gligoric, Darko Marinov, and Ralph

Friday, June 3, 2011 Afternoon Session 1:45 PM – 3:25 PM

Lane & Lyons Technical Talks

Lodato Technical Talks

1:45p–2:15p Dependency Injection Strategies in Scala Dick Wall Dependency Injection is a lightweight strategy used extensively in Java enterprise environments, and with a number of implementations in the Java domain. These Java libraries work fairly well under Scala, and provide some nice features like flexible binding DSLs and good error reporting for missing or incorrect configura-tion, as well as the potential for run time re-wiring. They also bring some limita-tions with them, and tend to rely on annotations as the least intrusive way to perform much of the configuration. Meanwhile in Scala, language features make for options like the cake pattern, which provide a much more integrated experi-ence, better compile time checking, and a good deal more type safety in many uses. However, some of the nicer polish is missing from the Java dependency injection options, like centralized configuration module management and merg-ing, along with an easy to use DSL that makes it easy for beginners to start using dependency injection without having to know about abstract fields and self types. This talk will discuss some of the different options available to the Scala develop-er for dependency injection, and some of the possibilities that might come from a solution intended to weave the best features of the Java and Scala approaches into an easy to use, easy to configure library that makes the best possible use of Scala language features. It will also be the first public outing for an open source library that I am working on based on these ideas, and developed in my work for Locus Development, where we are using and testing it already.

1:45p–2:15p Managing Binary Compatibility in Scala Mirco Dotta Binary compatibility is not a topic specific to the Scala language, but rather a concern for all languages targeting the JVM, Java included. Scala shares with Java many sources of potential binary incompatibilities, however, because of Scala greater expressiveness, Scala code has unique sources of incompatibility.

The Scala programming language offers several language constructs that do not have an equivalent in Java and are not natively supported by the JVM. Because of this, the Scala compiler (scalac) transforms these constructs into lower-lever, Java compatible, patterns that can be then easily translated into bytecode. Good examples of such high-level Scala constructs are traits, for mixin-based inheritance, and functions as first data citizens.

During this presentation we will review the main sources of binary incompatibil-ity for the Scala language, providing you with useful insights about how you should evolve your codebase to avoid binary incompatibilities. Furthermore, we will show a tool, the Migration Manager, that can be used to automatically diagnose binary incompatibilities between two versions of a same library.

2:20p–2:50p 18 Months With Scala: Building a Driver for MongoDB Brendan W. McAdams

A report of the lessons learned building "Casbah", an Open Source driver for MongoDB over the course of 18 months. When Casbah was started, the author had no Scala knowledge and used it as a learning basis. Casbah now includes a DSL for querying MongoDB and makes use of many Scala features including Type Classes. This talk covers the experiences of learning Scala while building a tool and lessons learned through trial and error. A number of design options did and did not work including experiments with abstract types versus type parameters and fun with manifests.

2:55p–3:25p Anorm: Plain Old SQL, Using Scala Collections, Pattern Matching, and Parsers to Simplify an Unnecessarily Over-complexified Task Sadek Drobi

Anorm is not an Object Relational Mapping. It is rather an SQL api for doing sim-pler JDBC. And since learning a new API is quite an investment, Anorm offers exclusively Scala preexisting interfaces for consuming an SQL query result. That includes Collections (Lists,Lazy Streams and Maps), Pattern Matching, and most interestingly, a Scala Parser Combinator API for constructing SQL parsers. This combination of interfaces yields a spectrum of usage that varies from transfor-mation of ad-hoc queries, to reusable and composeable parsers for consuming sophisticated graphs.

Page 24: June 2‒3, 2011 Stanford University Stanford, Adays2011.scala-lang.org/sites/days2011/files/Scala Days... · 2011-06-02 · Samira Tasharofi, Milos Gligoric, Darko Marinov, and Ralph
Page 25: June 2‒3, 2011 Stanford University Stanford, Adays2011.scala-lang.org/sites/days2011/files/Scala Days... · 2011-06-02 · Samira Tasharofi, Milos Gligoric, Darko Marinov, and Ralph

Friday, June 3, 2011 Afternoon Session 3:50 PM — 5:30 PM

McCaw Hall

3:50 PM — 5:30 PM Panel

Scala in the Enterprise: What Will It Take?

Moderator: Kunle Olukotun, Stanford University

Panelists:

Martin Odersky, Typesafe is a co-founder of Typesafe, the creator of the Scala programming language, and a professor in the programming research group at EPFL, the leading technical university in Switzerland. Throughout his career, Martin's singular objective has been to make the basic job of writing programs faster, easier and more enjoyable. In the process he has personally written more lines of Java and Scala code than almost any other individual in the world.

Alex Buckley, Oracle is Computational Theologist in the Java Platform Group at Oracle Corporation, responsible for the integrity and evolution of the Java Language Specification and Java VM Specification. He holds a Ph.D. in Computing from Imperial College London.

Dick Wall, Escalate Software is a veteran Java developer and reborn Scala developer. He is founder and co-host of the Java Posse podcast, a principal at Escalate Software along with Bill Venners, providing Scala training and consultancy, and a developer at Locus Development, a very small company doing some very hairy science and mathematics related to human genetics (in Scala). He also leads the Bay Area Scala Enthusiasts and believes people should be excellent to each other.

Ramnivas Laddad, VMware is a well-known expert in enterprise Java, especially in the area of AOP and Spring. He is a Spring Framework and Cloud Foundry committer. Ramnivas is also the author of AspectJ in Action, the best-selling book on AOP and AspectJ that has been lauded by industry experts for its presentation of practical and innovative AOP applications to solve real-world problems. Currently he leads a group at VMware that focuses on enterprise and developer experience for cloud computing. In recent years, Ramnivas has become a Scala fan.

Jorge Ortiz, Foursquare is an engineer working at Foursquare. He is an active contributor to the Scala community, and has helped developed several open-source Scala projects, including Rogue, a Scala DSL for MongoDB. Jorge graduated from Stanford and while there led a student-initiated course on Scala.

Page 26: June 2‒3, 2011 Stanford University Stanford, Adays2011.scala-lang.org/sites/days2011/files/Scala Days... · 2011-06-02 · Samira Tasharofi, Milos Gligoric, Darko Marinov, and Ralph
Page 27: June 2‒3, 2011 Stanford University Stanford, Adays2011.scala-lang.org/sites/days2011/files/Scala Days... · 2011-06-02 · Samira Tasharofi, Milos Gligoric, Darko Marinov, and Ralph

June 2—3, 2011 Organizers

General Chair Kunle Olukotun, Stanford University

General Co-Chair Hassan Chafi, Stanford University

Program Chair Martin Odersky, EPFL

Program Committee Nathan Bronson, Stanford University

Miguel Garcia, EPFL

Klaus Havelund, Jet Propulsion Laboratory

Cay Horstmann, San Jose State University

Doug Lea, State University of New York at Oswego

Nate Nystrom, University of Lugano

James Strachan, FuseSource

Organization Committee Phil Bagwell, EPFL

Kevin Brown, Stanford University

Antonio Cunei, EPFL

Darlene Hadding, Stanford University

Philipp Haller, Stanford University

HyoukJoong Lee, Stanford University

Arvind Sujeeth, Stanford University

Page 28: June 2‒3, 2011 Stanford University Stanford, Adays2011.scala-lang.org/sites/days2011/files/Scala Days... · 2011-06-02 · Samira Tasharofi, Milos Gligoric, Darko Marinov, and Ralph

We would like to thank the following Scala Days 2011 sponsors: