Status message

This proposal has been approved and the Eclipse N4JS project has been created.

Eclipse N4JS

Basics

This proposal is in the Project Proposal Phase (as defined in the Eclipse Development Process) and is written to declare its intent and scope. We solicit additional participation and input from the community. Please login and add your feedback in the comments section.

ECMAScript, popularly known as JavaScript, has become an important programming language, not only as a scripting language for web pages, but also for larger projects, including rich web applications and even back-end software. In order to develop large projects successfully, static validation and sophisticated tooling are crucial. N4JS enriches ECMAScript with a static type system and provides extensive support for static validation hosted within a feature-rich IDE.

Scope:

N4JS is an extension of ECMAScript providing a sound type system. It provides a transpiler to translate N4JS files to plain ECMAScript. The N4JS IDE enables the authoring of JS and N4JS files, providing tool support analogous to that of best-of-breed Java IDEs, e.g., Eclipse JDT.

Description:

N4JS adds a static type system similar to that of Java to ECMAScript 2015. This type system support nominal and structural typing, in both cases supporting generics similar to that of Java 8. In order to capture details specific to ECMAScript,additional constructs are introduced such as union types, 'this' type, and special forms of structural types. Additional concepts required for larger projects are built in, e.g., dependency injection, test support, and various component types.

N4JS provides an extensible framework for representing and manipulating JS and N4JS files.Based on this framework, it provides integrated, extensible tooling that supports instantaneous validation, content assist, and quick fixes, as well as launch support for running the code and associated tests.

Why Here?:

The N4JS IDE is based on the Eclipse platform and uses many associated Eclipse technologies, in particular Xtext. Not only does it provide a Java-based ECMAScript 2015 parser, it also produces EMF-based models for both the abstract syntax tree (AST) of JS and N4JS as well as the type model of N4JS. This makes it an ideal basis for implementing a host of interesting tools to analyze, maniuplulate, and transform JS and N4JS.

N4JS aims to build a community of contributors who will help build a powerful, feature-rich IDE.

The project is already using a build process similar to the one used by Eclipse projects, so it should be possible to quickly set up the Eclipse project with a nightly build once the project gets approved and the initial contribution as gone through the due diligence process.

Future Work:

The current version is already stable and has been in production mode internally for over a year. Fixing bugs and adding minor improvements are on going work, of course. Additionally, the following topics are expected to be addressed:

Improved UI experience, in particular customized content assist as well as more quick fixes.

Although tooling only supports N4JS and plain ECMAScript at the moment, it should be possible to also provide support for other ECMAScript typing approaches such as TypeScript in the future. Whether this is added or not depends on the community feedback and involvement.

The initial contribution consists of the N4JS IDE (and a headless version), tests, and a small ECMAScript runtime library. The code base consists of approximately 8,000 files. The pedigree of the code is as follows:

The majority of the code is written either by NumberFour employees or by consultants working for NumberFour. This copyright holder for this code is by NumberFour AG.

The ECMAScript test suite (github.com/tc39/test262, BSD License) in two versions (for ECMAScript 5 and ECMAScript 2015). For performance reasons, parts of these tests suits are archived and included in the test sources.