Home // International Journal On Advances in Software, volume 9, numbers 3 and 4, 2016 // View article
Implementing a Typed Javascript and its IDE: a case-study with Xsemantics
Authors:
Lorenzo Bettini
Jens von Pilgrim
Mark-Oliver Reiser
Keywords: DSL; Type System; Implementation; Eclipse
Abstract:
Developing a compiler and an IDE for a programming language is time consuming and it poses several challenges, even when using language workbenches like Xtext that provides Eclipse integration. A complex type system with powerful type inference mechanisms needs to be implemented efficiently, otherwise its implementation will undermine the effective usability of the IDE: the editor must be responsive even when type inference takes place in the background, otherwise the programmer will experience too many lags. In this paper, we will present a real-world case study: N4JS, a JavaScript dialect with a full-featured Java-like static type system, including generics, and present some evaluation results. We will describe the implementation of its type system and we will focus on techniques to make the type system implementation of N4JS integrate efficiently with Eclipse. For the implementation of the type system of N4JS we use Xsemantics, a DSL for writing type systems, reduction rules and in general relation rules for languages implemented in Xtext. Xsemantics is intended for developers who are familiar with formal type systems and operational semantics since it uses a syntax that resembles rules in a formal setting. This way, the implementation of formally defined type rules can be implemented easier and more directly in Xsemantics than in Java.
Pages: 283 to 303
Copyright: Copyright (c) to authors, 2016. Used with permission.
Publication date: December 31, 2016
Published in: journal
ISSN: 1942-2628