Scala.js: Type-Directed Interoperability with Dynamically Typed Languages

Interoperability between statically typed and dynamically typed languages is increasingly important, as can be witnessed by the many statically typed languages targeting JavaScript. Interoperating with both the object-oriented and functional features of JavaScript is essential, if only to manipulate the DOM, yet existing languages have very poor support for this. We present Scala.js, a dialect of Scala compiling to JavaScript. Its interoperability system is based on a powerful and intuitive framework for type-directed interoperability with dynamically typed languages. The framework combines facade types for JavaScript values; user-defined, implicit, type-directed cross-language conversions; and a Dynamic type building on facade types and implicit conversions. It accommodates both the functional and object-oriented features of Scala and JavaScript, and provides very natural interoperability between the two languages. It is expressive enough to represent the DOM and jQuery APIs, among others, both in its statically typed and dynamically typed flavors.


Année
2013
Mots-clefs:
Laboratoires:




 Notice créée le 2013-12-03, modifiée le 2019-03-16

n/a:
Télécharger le document
PDF

Évaluer ce document:

Rate this document:
1
2
3
 
(Pas encore évalué)