This is the list of full papers accepted to the Second Scala Workshop (in random order):
- Scala.react: Embedded Reactive Programming in Scala (link)
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 implementation makes use of dynamic dataflow graphs, delimited continuations and implicit parameters in order to achieve certain semantic guarantees and concise syntax.
- Parallelizing Machine Learning– Functionally: A Framework and Abstractions for Parallel Graph Processing (link)
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.
- Lafros MaCS Programmable Devices: case study in type-safe API design using Scala (link)
Rob Dickens
Lafros MaCS is an experimental Scala API for building distributed monitoring and control systems, and features reusable software modules known as Programmable 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.
- Checking Flight Rules with TraceContract - Application of a Scala DSL for Trace Analysis (link)
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 developers 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 specifications of flight rules.
- Setac: A Framework for Phased Deterministic Testing of Scala Actor Programs Programs (link)
Samira Tasharofi, Milos Gligoric, Darko Marinov, and Ralph Johnson
Scala provides an actor library where computation entities, called actors, communicate 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) allows 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.
- Compiling Scala to LLVM (link)
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 provide a universal intermediate representation for compilers to target and a framework 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.
- Loop Recognition in C++/Java/Go/Scala (link)
Robert Hundt
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 language and runtime features to achieve maximum performance. This approach allows an almost fair comparison of language features, code complexity, compilers 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 benchmark and subsequent tuning effort might be indicatie of typical performance pain points in the respective languages.
- MUTS: Native Scala Constructs for Software Transactional Memory (link)
Daniel Goodman, Behram Khan, Salman Khan, Chris Kirkham, Mikel Lujan and Ian Watson
In this paper we argue that the current approaches to implementing transactional memory in Scala, while very clean, adversely affect the programmability, readability 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 transactions 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 transactions 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.
In addition to the presentation of the above papers, Scala Days will include many other technical presentations, experience reports, and tool demonstrations: we will be able to offer you at least 15 to 20 further talks and topics to choose from!