SlideShare is now on Android. 15 million presentations at your fingertips.  Get the app

×
  • Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
 

Scala for scripting

by on Apr 29, 2010

  • 4,120 views

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 ...

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.

Statistics

Views

Total Views
4,120
Views on SlideShare
4,082
Embed Views
38

Actions

Likes
1
Downloads
36
Comments
0

3 Embeds 38

http://www.slideshare.net 33
http://author.day.com 3
http://www.linkedin.com 2

Accessibility

Categories

Upload Details

Uploaded via SlideShare as Apple Keynote

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
Post Comment
Edit your comment

Scala for scripting Scala for scripting Presentation Transcript