JS++

{{Short description|Web programming language}}

{{Infobox programming language

| title = JS++

| screenshot =

| screenshot caption =

| paradigm = Multi-paradigm: Imperative, structured, object-oriented, functional, generic

| family = ECMAScript

| released = {{Start date and age|2011|10|08}}

| designer = Roger Poon, Anton Rapetov

| developer = Onux

| discontinued =

| latest release version = 0.10.0

| latest release date = {{Start date and age|2021|12|10}}

| latest preview version =

| latest preview date =

| typing = Gradual, static, dynamic

| scope = lexical

| programming language =

| license = BSD

| file ext = .jspp, .js++, .jpp

| file format =

| website = {{URL|www.onux.com/jspp}}

| implementations =

| dialects =

| influenced by = C, C++, C#, Java, JavaScript

| influenced =

}}

JS++ is a programming language for web development that extends JavaScript with a sound type system. It includes imperative, object-oriented, functional, and generic programming features. It is free and open-source software released under a BSD license.

History

JS++ first appeared on October 8, 2011.{{cite web |url=http://jspp.javascript.am/ |archive-url=https://web.archive.org/web/20111017221312/http://jspp.javascript.am/ |url-status=dead |archive-date=17 October 2011 |title=JavaScript++: New, Powerful Language for Better Web Development |date=17 October 2011}}{{cite news |date=12 October 2011 |title=C++ et Javascript = Javascript++ |url=http://www.lafermeduweb.net/veille/c-et-javascript-javascript-123284133702156289.html |work=La ferme du web |url-status=dead |archive-url=https://web.archive.org/web/20111012143226/http://www.lafermeduweb.net/veille/c-et-javascript-javascript-123284133702156289.html |archive-date=12 October 2011}}{{cite news |date=18 October 2011 |url=http://jspp.javascript.am/downloads/ |title=Index of /downloads |archive-url=https://web.archive.org/web/20111018172906/http://jspp.javascript.am/downloads/ |url-status=dead |archive-date=18 October 2011}} The modern implementation was announced at DeveloperWeek 2016{{cite news |date=13 February 2016 |url=http://www.developerweek.com/javascript-conference/ |title=JavaScript Conference - DeveloperWeek 2016 - February 12–18 |archive-url=https://web.archive.org/web/20160213204925/http://www.developerweek.com/javascript-conference/ |url-status=dead |archive-date=13 February 2016}} and released on May 31, 2016.{{cite news |last1=Poon |first1=Roger |date=May 31, 2016 |url=https://www.onux.com/jspp/blog/jspp-goes-into-public-beta/ |title=JS++ Goes Into Public Beta |website=Onux.com}}{{cite news |last1=Handy |first1=Alex |date=June 1, 2016 |url=http://sdtimes.com/onux-seeks-fix-javascripts-lack-type-safety/ |title=Onux seeks to fix JavaScript's lack of type safety |work=SD Times}}{{cite news |last1=Krill |first1=Paul |date=June 6, 2016 |url=https://www.infoworld.com/article/3079092/javascript/new-compiler-tackles-javascripts-weak-typing.html |title=New compiler tackles JavaScript's weak typing |work=InfoWorld}}{{cite news |last1=Cimpanu |first1=Catalin |date=June 9, 2016 |url=https://news.softpedia.com/news/jquery-3-0-released-and-other-javascript-news-505064.shtml |title=jQuery 3.0 Released and Other JavaScript News |work=Softpedia}} The language is designed by Roger Poon and Anton Rapetov.

Syntax

= Type annotations =

Since JS++ is a superset of JavaScript, declaring data 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);

}

}

Features

JS++ features a type system that is sound.{{cite web |url=https://www.onux.com/jspp/tutorials/type-system |title=The JS++ Type System |website=Onux.com}}{{cite news |last1=Bridgwater |first1=Adrian |date=June 13, 2016 |url=http://www.computerweekly.com/blog/Open-Source-Insider/Onux-JS-an-answer-to-JavaScript-brittle-type-safety |title=Onux JS++, an answer to JavaScript 'brittle' type safety? |work=Computer Weekly}}

JS++ can efficiently analyze out-of-bounds errors at compile time.{{cite news |last1=Díaz |first1=Fabio |date=January 23, 2019 |url=https://www.akuaroworld.com/js-the-javascript-superset-is-getting-rid-of-out-of-bounds-errors/ |title=JS++, the JavaScript superset, is getting rid of out-of-bounds errors |work=Akuaroworld}}{{cite news |last1=Cardoza |first1=Christina |date=January 16, 2019 |url=https://sdtimes.com/softwaredev/js-programming-language-looks-to-solve-out-of-bounds-errors/ |title=JS++ programming language looks to solve out-of-bounds errors |work=SD Times}}{{cite news |last1=Poon |first1=Roger |date=January 11, 2019 |url=https://www.onux.com/jspp/blog/jspp-0-9-0-efficient-compile-time-analysis-of-out-of-bounds-errors/ |title=JS++ 0.9.0: Efficient Compile Time Analysis of Out-of-Bounds Errors |website=Onux.com}}

Development tools

= Compiler =

The JS++ compiler is available for Windows, macOS, and Linux. It is a source-to-source compiler which emits JavaScript source code as an intermediate representation.

= Editor integration =

JS++ integrates with various code editors including Visual Studio Code, Atom, and Sublime Text.{{cite news |url=http://www.computerworld.com/article/3132920/application-development/javascript-superset-js-adds-dead-code-elimination-and-more.html |title=JavaScript superset JS++ adds dead code elimination and more |work=Computerworld |date=October 19, 2016}}{{cite news |last1=Cardoza |first1=Christina |date=October 19, 2016 |url=http://sdtimes.com/js-0-4-2-released-code-editor-integrations-modules-dead-code-elimination/ |title=JS++ 0.4.2 released with code editor integrations, modules and dead code elimination |work=SD Times}}{{cite news |last1=Clark |first1=Geneva |date=October 20, 2016 |url=https://www.zeolearn.com/magazine/jspp-0.4.2-release-with-upgrades |title=JS++ 0.4.2 Release - Upgraded With Modular Design, Dead Code Elimination, and Multiple Code Editors |work=Zeomag}}

= Build tools =

JS++ can be integrated with third-party build tools like Webpack.{{cite web |last1=Phoenix |first1=Ingwie |date=7 December 2018 |url=https://github.com/IngwiePhoenix/jspp-webpack-poc |title=Proof of Concept: Using JS++ with WebPack |publisher=Ingwie Phoenix |website=GitHub}}

Release history

class="wikitable sortable"
Version number

! Release date

! Changes

0.01

| {{start date|df=yes|2011|10|08}}

| Alpha version, initial release

0.011

| {{start date|df=yes|2011|10|10}}

| Alpha version

0.012

| {{start date|df=yes|2011|10|25}}

| Alpha version

0.013

| {{start date|df=yes|2012|01|29}}

| Alpha version

0.014.1

| {{start date|df=yes|2012|08|15}}

| Alpha version

0.4.1

| {{start date|df=yes|2016|05|31}}

| Beta version, array and callback types, character literals, integral suffixes, removed ECMAScript ASI

0.4.2

| {{start date|df=yes|2016|10|18}}

| Modules, function overloading, dead code elimination, editor integrations

0.4.2.1

| {{start date|df=yes|2016|10|24}}

| Bug fixes

0.4.2.2

| {{start date|df=yes|2016|11|17}}

| Source map debugging

0.4.2.4

| {{start date|df=yes|2016|12|25}}

| Support for Mac OS X, C-style casts, callback and array conversions

0.5.0

| {{start date|df=yes|2017|03|13}}

| Classes

0.5.1

| {{start date|df=yes|2017|03|26}}

| 'foreach' loops

0.5.2

| {{start date|df=yes|2017|07|27}}

| BSD License, Interfaces, Abstract Classes, Virtual Methods, Auto-boxing

0.7.0

| {{start date|df=yes|2017|10|27}}

| All ECMAScript 3 features via Array and Standard Library

0.8.0

| {{start date|df=yes|2018|03|15}}

| Generic programming, Dictionary, multi-line strings, .js++ file extension

0.8.1

| {{start date|df=yes|2018|03|27}}

| auto, catch-all clauses, standard library modules for handling time, bug fixes

0.8.4

| {{start date|df=yes|2018|05|23}}

| New string functions, advanced generics, bug fixes, standard library expansion

0.8.5

| {{start date|df=yes|2018|06|02}}

| Bug fixes

0.8.10

| {{start date|df=yes|2018|11|24}}

| Faster compile times, stacks, queues, Unicode, Base64, generic default constraint rules

0.9.0

| {{start date|df=yes|2019|01|11}}

| Efficient compile time out-of-bounds error analysis

0.9.1

| {{start date|df=yes|2019|07|01}}

| Bug fixes

0.9.2

| {{start date|df=yes|2019|10|18}}

| Final (immutable) variables and default to 64-bit for macOS Catalina

See also

References