University of Cambridge > Talks.cam > Semantics Lunch (Computer Laboratory) > Interoperability in a Scripted World

Interoperability in a Scripted World

Add to your list(s) Download to your calendar using vCal

If you have a question about this talk, please contact Sam Staton.

Scripting languages, such as JavaScript, are used to quickly and easily develop small programs. Frequently, these programs are combined with libraries and other programs from “conventional” languages, such as Java, to build larger and more robust applications.

Bridging the gap between languages requires data conversions and runtime checks at the border. Relying on programmers to write either is tedious and can introduce subtle errors, so instead we add language and compiler support for the border-crossing operations. Current techniques only support combining languages with similar data representations and runtime semantics, which excludes popular language combinations.

In this talk, I will explain the current state of interoperability and then present advances which support combining Java and JavaScript. These languages have different means of inheritance, representation, and operations—Java, with class-based extension, separation of fields and methods, and a statically fixed structure, and JavaScript, with prototype-based extension, uniform members, and fully mutable structure. To allow a Java object to pass to JavaScript, I use a contract-like embedding which causes the JavaScript program to treat the value as a JavaScript object, and vice-versa. This allows programs written in languages with differing semantics to cooperate in one program safely and soundly.

Class-extension and prototype-extension are the two predominate means of inheritance in the object world and programs using existing libraries may need to support extension through the appropriate style of inheritance. I show how we can mix these two styles, with the contract-like embeddings preserving safety-properties and data representations across inherited methods and fields.

This talk is part of the Semantics Lunch (Computer Laboratory) series.

Tell a friend about this talk:

This talk is included in these lists:

Note that ex-directory lists are not shown.

 

© 2006-2024 Talks.cam, University of Cambridge. Contact Us | Help and Documentation | Privacy and Publicity