London-based Onux thinks it has the solution to JavaScript woes. The company announced today that it has released JS++, a type-safe version of JavaScript that it has created over the past few years.
Roger Poon, founder of Onux, said, “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. 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. What Microsoft did, what Facebook did, they took this very complex problem and made it more complex.”
(Related: What’s next in store for JavaScript)
JS++ is available online for free. It is currently in a preview at version 0.4.1 for early adopters.
Poon takes issue with other attempts to bring type safety into JavaScript. “Unlike other efforts that pollute their type systems with JavaScript’s types, JS++ effectively isolates JavaScript,” he said. “It’s ‘sanitizing’ 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.”
While the software is available for free, Onux has a patent pending on this new version of type safety in JavaScript, so it remains to be seen whether this is truly an unencumbered language. While the patent may never be invoked, a patented language is generally not welcomed by software developers in the open-source community.
Still, Poon remains confident that JS++ has what developers want. “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,” he said. “Instead, developers want type guarantees. Essentially, to use the vernacular, they want a sound type system. Our patent-pending technology is the solution here.”