Onux Announces JS++, the First Reliable Successor to JavaScript

PR Newswire

SAN FRANCISCO, June 7, 2016 /PRNewswire-iReach/ -- JavaScript is a brittle programming language. One "type error" can bring down a server or application written in JavaScript. Microsoft, Facebook, Google, and numerous universities have attempted to solve this problem, with limited success. Onux, a programming language and compiler company founded in London with operations in Silicon Valley, thinks it has a solution with the invention of a "sound" type system.

"The challenge with solving a problem of this magnitude is that there is just so much code and so much that has happened since JavaScript was first introduced in 1995. Secondly, it's very difficult to analyze JavaScript without actually executing code, and the code can execute differently across web browsers and platforms," says Roger Poon, the company's founder. "We've worked on this problem since 2011. We tried everything under the sun from cutting-edge research on type inference to gradual typing. What we've done is we've taken this very complex problem and simplified it. That's how we reached our solution after many years."

JS++'s patent-pending solution involves "unifying" all JavaScript types into a single type known as the "unified external type." Types in JavaScript are difficult to get correctly at compile time. From "host objects" providing implementation-defined types (as legally permitted by ECMAScript, JavaScript's official language standard) to buggy and inconsistent web browser implementations, there are hundreds of problems that have made simply adding types to JavaScript a difficult challenge.

"Unlike other efforts that pollute their type systems with JavaScript's types, JS++ effectively isolates JavaScript," Poon says. Once JavaScript is isolated, JS++ will perform automatic safeguarding and conversions between JS++ types and JavaScript types. "It's 'santizing' the data so the types will always remain correct. Conversions are a very 'lightweight' mechanism because they only need to happen on variable declarations, assignments, and function calls. Thus, we get type safety without sacrificing the ability to build performance-sensitive applications."

Most programming languages share the same primitive data types such as Booleans, strings, and various number types. Conversions in these cases are straightforward, but JS++ takes it further. In object-oriented programming, developers can often construct classes that can expand the types for a program to thousands of types. How can data with unpredictable formats and structures be converted? In this case, JS++ enables developers to define custom conversion rules. Poon clarifies, "It's easy to figure out how to convert Booleans and strings. We wanted JS++ to be easy and seamless so we provide built-in conversions for these primitive data types. However, with constructed types, the implementation for one StringArray class might be different from another, so we let the user specify exactly how she wants the data safeguarded and converted from JS++ to JavaScript and vise versa."

JS++ enables developers to fully use their existing JavaScript code and libraries. For enterprise web applications, where the amount of JavaScript source code can exceed 1 million lines of code, JS++ enables developers to "incrementally" add types to their code and gain type safety over time.

"Developers don't want their types erased at runtime. Otherwise, it's just labor-intensive to declare them at all when thousands of them can be incorrect on every tenth run of the application. Instead, developers want type guarantees. Essentially, to use the vernacular, they want a sound type system. Our patent-pending technology is the solution here," Poon says.

In a sound type system, type declarations are always guaranteed to be correct. When types can be "guaranteed" to be correct, developers can make small incremental changes to large code bases with confidence. This is known as "optional typing" and provides flexibility in complex software projects. In JS++, "guarantees" are achieved through forced data conversions.

JS++ has been released in open beta and is free to download. It's still a work in progress, but a typed superset of JavaScript is currently available with object-oriented programming via classes and modules arriving later this year. Visit the official website to download JS++.

Media Contact: Roger Poon, Onux, 628-222-0010, press@onux.com

News distributed by PR Newswire iReach: https://ireach.prnewswire.com

 

View Comments (0)