Date and time:
Thursday, April 15, 2010 - 13:45 - 15:25
- Lightweight Language Processing in Kiama and Scala
Anthony M. Sloane
Kiama is a language processing library for the Scala programming language. The project aims to bring high-level language processing paradigms within the reach of Scala programmers. Kiama contains embedded domain-specific languages to support tree annotation via attribute grammars, tree transformation via strategy-based rewriting, and dynamic semantics via abstract state machines. In each case, the embedded languages closely resemble equivalent notations used in generator-based systems, but are much more lightweight since they require no generation phase other than compilation and can easily interoperate with each other or with other Scala code. This talk will provide an overview of Kiama's capabilities and implementation using a series of typical language processing examples.
- Scala for Scripting
Michael Dürig
Its conciseness, versatility and DSL capabilities makes Scala desirable for scripting. In this report we show how we implemented a JSR223 compliant script engine for Scala which runs inside OSGi environments.
While the Scala compiler needs a class path to load class files, OSGi only provides class loaders. To overcome this we implemented a file system abstraction on top of OSGi bundles effectively providing a class path. Furthermore, JSR223's dynamic approach for passing arguments does not play well with Scala's static types. We need to make all types of arguments visible to scripts. Our implementation generates a preamble of adequate implicit conversions which allows scripts to use statically typed variables in a manner resembling dynamic types. Finally performance constraints require caching of pre-compiled scripts.
Apache Sling, an OSGi based web application framework with a scriptable application layer, uses our implementation for type safe templating via Scala's XML support.
- Named and Default Arguments in Scala
Lukas Rytz
This talk is about the design and implementation of named and default arguments in the Scala programming language. While these features are available in many other languages there are significant differences in the actual implementations. Scala presents a design that unifies the most reasonable properties for an object-oriented language and provides new possibilities by allowing default arguments on generic and implicit parameters. We will show how Scala's default arguments are expressive enough to solve the problem of writing a lightweight generic update function for algebraic datatypes.
Due to space constraints, the session is limited to max 50-60 people.