Using Path-Dependent Types to Build Type Safe JavaScript Foreign Function Interfaces

Julien Richard-Foy 1 Olivier Barais 1 Jean-Marc Jézéquel 1
1 DiverSe - Diversity-centric Software Engineering
Inria Rennes – Bretagne Atlantique , IRISA-D4 - LANGAGE ET GÉNIE LOGICIEL
Abstract : The popularity of statically typed programming languages compiling to JavaScript shows that there exists a fringe of the programmer population interested in leveraging the benefits of static typing to write Web applications. To be of any use, these languages need to statically expose the Web browser dynamically typed native API, which seems to be a contradiction in terms. Indeed, we observe that existing statically typed languages compiling to JavaScript expose the browser API in ways that either are not type safe, or when they are, typically over constrain the programmers. This article presents new ways to encode the challenging parts of the Web browser API in static type systems such that both type safety and expressive power are preserved. Our first encoding relies on type parameters and can be implemented in most mainstream languages but drags phantom types up to the usage sites. The second encoding does not suffer from this inconvenience but requires the support of dependent types in the language.
Type de document :
Communication dans un congrès
ICWE - 14th International Conference on Web Engineering, Jul 2014, Toulouse, France. 2014


https://hal.inria.fr/hal-01026148
Contributeur : Julien Richard-Foy <>
Soumis le : dimanche 20 juillet 2014 - 16:48:40
Dernière modification le : jeudi 9 février 2017 - 16:03:30
Document(s) archivé(s) le : lundi 24 novembre 2014 - 20:48:16

Fichier

icwe14.pdf
Fichiers produits par l'(les) auteur(s)

Identifiants

  • HAL Id : hal-01026148, version 1

Citation

Julien Richard-Foy, Olivier Barais, Jean-Marc Jézéquel. Using Path-Dependent Types to Build Type Safe JavaScript Foreign Function Interfaces. ICWE - 14th International Conference on Web Engineering, Jul 2014, Toulouse, France. 2014. <hal-01026148>

Partager

Métriques

Consultations de
la notice

409

Téléchargements du document

263