Using Aspects for Language Portability (SCAM 2010)
Upcoming SlideShare
Loading in...5
×
 

Using Aspects for Language Portability (SCAM 2010)

on

  • 784 views

Software platforms such as the Java Virtual Machine or the CLR .NET virtual machine have their own ecosystem of a core programming language or instruction set, libraries, and developer community. ...

Software platforms such as the Java Virtual Machine or the CLR .NET virtual machine have their own ecosystem of a core programming language or instruction set, libraries, and developer community. Programming languages can target multiple software platforms to increase interoperability or to boost performance. Introducing a new compiler backend for a language is the first step towards targeting a new platform, translating the language to the platform\'s language or instruction set. Programs written in modern languages generally make extensive use of APIs, based on the runtime system of the software platform, introducing additional portability concerns. They may use APIs that are implemented by platform-specific libraries. Libraries may perform platform-specific operations, make direct native calls, or make assumptions about performance characteristics of operations or about the file system. This paper proposes to use aspect weaving to invasively adapt programs and libraries to address such portability concerns, and identifies four classes of aspects for this purpose. We evaluate this approach through a case study where we retarget the Stratego program transformation language towards the Java Virtual Machine.

Statistics

Views

Total Views
784
Views on SlideShare
784
Embed Views
0

Actions

Likes
0
Downloads
3
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via 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
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • <br />
  • <br />
  • DSLs and other high-level languages <br /> target SOFTWARE PLATFORM instead <br />
  • <br />
  • (no javascript logo google found me this one instead) <br />
  • want to have the same programs and the same libraries run on the new platform <br />
  • <br />
  • <br />
  • To show you how we can do that we did a case study <br /> our SCAM language <br />
  • To show you how we can do that we did a case study <br /> our SCAM language <br />
  • To show you how we can do that we did a case study <br /> our SCAM language <br />
  • To show you how we can do that we did a case study <br /> our SCAM language <br />
  • To show you how we can do that we did a case study <br /> our SCAM language <br />
  • Running Stratego on Java was kind of a big deal for us <br /> <br /> Other advantages: performance, developer community <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • &#x201C;hides differences among platforms&#x201D; <br />
  • pp-java <br />
  • pp-java <br />
  • <br />
  • <br />
  • <br />

Using Aspects for Language Portability (SCAM 2010) Using Aspects for Language Portability (SCAM 2010) Presentation Transcript

  • Using Aspects for Language Portability Lennart Kats Eelco Visser
  • DSLs Stratego SDF Spoofax
  • DSL compilers (code generators) DSL Generator
  • Backend targets the platform DSL Frontend Backend
  • Backend targets the platforms DSL Frontend Backend Backend Backend
  • “So switching to another platform is just a little matter of switching the backend, right?” (wrong)
  • Why not? • platform-exclusive libraries • platform escapes and native calls • interoperability and integration with platform applications • performance and stack behavior
  • Then what? Use aspect weaving to address portability issues in programs and libraries!
  • Our case study Frontend Backend C/POSIX Stratego/XT
  • Our case study Frontend Backend C/POSIX Stratego/XT Backend
  • Why Java? (spoofax.org)
  • Architecture Frontend Backend
  • Architecture Frontend Standard libs Backend Programs
  • Architecture Frontend Standard libs Primitives Backend Programs Platform libs
  • Architecture Frontend Standard libs Primitives Backend Programs Platform libs
  • Architecture Frontend Standard libs Primitives Backend Programs Platform libs Portability aspects
  • 1. Glue code aspects Override functions and library invocations to work with platform-specific libraries • SGLR vs. JSGLR • ORM • communication • etc.
  • 2. Migration aspects Because we cannot solve all portability problems (right away) • There may be no alternative for a library • Primitives may make assumptions about the platform (e.g., POSIX vs. Java)
  • 2. Migration aspects Warn developers about unportable code Perform “next best” operation
  • 3. Integration aspects Enhance platform integration: • error handling (exceptions, console vs. GUI) • logging • hooks • user interaction (console vs. GUI vs. web)
  • 4. Optimization aspects Address platform performance issues of... ...expensive operations ...common operations (bottlenecks) by using platform-specific code or by using code more suited for the platform
  • Summary Many additional portability issues • replacing the backend is not enough! AOP elegantly addresses them • four classes of portability aspects • encapsulate platform concerns in separate libraries