Microsoft Announces JavaScript Rival TypeScript
Microsoft has introduced TypeScript, the successor to JavaScript.
S. Somasegar, Corporate Vice President of the Developer Division at Microsoft, revealed on last week Microsoft's latest answer to JavaScript: a new programming language called TypeScript. Somasegar says the new language is not only aimed at making JavaScript development scale beyond the client, but easier to create large-scale JavaScript applications.
"TypeScript is a superset of JavaScript that combines type checking and static analysis, explicit interfaces, and best practices into a single language and compiler," he writes. "By building on JavaScript, TypeScript keeps you close to the runtime you’re targeting while adding only the syntactic sugar necessary to support large applications and large teams."
JavaScript that's already developed can be brought into the TypeScript "world", as all JavaScript code is already TypeScript code. Programmers can literally copy-and-paste from an existing JavaScript program into a TypeScript file, he said.
In an example, Somasegar complied JavaScript code that was treated like TypeScript. The output was essentially the same JavaScript code save for a few additional whitespaces and semi-colon insertions. TypeScript also allowed him to insert a simple inline type annotation to fix a bug in the original script.
"Because of TypeScript’s closeness to JavaScript, interoperability between TypeScript and JavaScript is simple," he writes. "TypeScript not only allows users to continue using their existing JavaScript libraries, it also allows those users to get early error detection and better tooling using a declare file."
Microsoft is making the new language open-source under the Open Web Foundation’s Final Specification Agreement (OWFa 1.0). Microsoft’s implementation of the compiler is also available on CodePlex (with git) under the Apache 2.0 license. Over the next few months, the TypeScript team will continue to develop CodePlex in the open.
"TypeScript builds upon the good work happening in the TC39 committee, which determines the direction of the ECMAScript standard, the formal standard for JavaScript," he writes. "We continue to work with the committee to evolve the JavaScript language and runtime capabilities. Should the community desire us to go even further and submit TypeScript to the standards body, we’re open to that, too."
Stay On the Cutting Edge: Get the Tom's Hardware Newsletter
Get Tom's Hardware's best news and in-depth reviews, straight to your inbox.
Somasegar says the new language is an early preview, and invites the community give it a test drive. That said, developers can learn more about the TypeScript project here, download an early preview, read and discuss the language specification, explore the online playground, and peruse the source of the compiler (on the TypeScript project site on CodePlex, with git).
A 53-minute video overview can be watched here.
This dazzling Raspberry Pi Christmas light show is incredible
Apple Touch Bar turns into a $119 standalone gadget — Flexbar features a 10-inch aluminum body with a 2K AMOLED display that communicates with a USB-C cable
Discrete GPU sales dip while Nvidia continues to dominate — iGPUs increase while discrete GPUs decline
-
cryogenic "Microsoft Announces JavaScript Rival TypeScript"Reply
Rival? really?
Type Script is build on top of, and compiles to Javascript, while also being a strict superset of javacript.
I fail to see how the two rival each other when TypeScript cannot exist without javascript...
-
booyaah I live in a dream world where C# and Java are the native client side languages for all web browsers :)Reply
-
xcaninox it's not a rival, as cryogenic noted it was built on top of Javascript therefore it is like an extension or an evolution, not exactly a rival, Microsoft can claim what ever they won't but that doesn't change the facts.Reply -
mayankleoboy1 will FAIL.Reply
Just like Google's "dart" and multiple other scripting languages.
unless this TypeScript has multiprocessing, its a waste of time. -
techslave3 All this before Microsoft announces its competitor to the power button. How surprising.Reply -
Fire-Dragon-DoL 9412551 said:will FAIL.
Just like Google's "dart" and multiple other scripting languages.
unless this TypeScript has multiprocessing, its a waste of time.
That's stupid to say, note that something similar to typescript (which is basically the same as javascript except that you can specify variable types) is already implemented in Unity (the game engine).
There is Coffee which does the same too.
It's just another scripting language to help people writing javascript without being mad.