Top Qs
Timeline
Chat
Perspective
JS++
Web programming language From Wikipedia, the free encyclopedia
Remove ads
JS++ is a BSD-licensed programming language for web development that extends JavaScript with a sound type system. It includes imperative, object-oriented, functional, and generic programming features.
Remove ads
History
JS++ first appeared on October 8, 2011.[1][2][3] The modern implementation was announced at DeveloperWeek 2016[4] and released on May 31, 2016.[5][6][7][8] The language is designed by Roger Poon and Anton Rapetov.
Syntax
Type annotations
Since JS++ is a superset of JavaScript, declaring types for variables is optional.
int x = 1; // declares the variable x with an "internal type" (JS++ type)
var y = 2; // declares the variable y with an "external type" (JavaScript type)
bool z = true; // declares the variable z with an "internal type" (JS++ type)
Example
The following example is available on the homepage of JS++.
import System;
// Import JavaScript libraries in one line of code
external jQuery, $;
class Example {
public Example() {
// Nearly NO learning curve
// You can keep writing regular JavaScript
var a = 0, random = Math.random();
// Integer types and other primitives
// ... enable fast (optimized) and clear code
byte[] rgbColors = [ 0xFF, 0xFA, 0xFF ];
}
public void showMessage(int id, string text) {
// 100% compatible with regular JavaScript
jQuery("#msgbox").show();
$("#msgbox").text(id.toString() + text);
}
}
Remove ads
Features
JS++ features a type system that is sound.[9][10]
JS++ is able to efficiently analyze out-of-bounds errors at compile time.[11][12][13]
Development tools
Compiler
The JS++ compiler is available for Windows, Mac OS X, and Linux. The compiler generates JavaScript output.
Editor integration
JS++ integrates with various code editors including Visual Studio Code, Atom, and Sublime Text.[14][15][16]
Build tools
JS++ can be integrated with third-party build tools like Webpack.[17]
Release history
Remove ads
See also
References
Wikiwand - on
Seamless Wikipedia browsing. On steroids.
Remove ads