TypeScript: Microsoft’s New Take on Javascript, from the Creator of C#
Microsoft started October with a bang, unveiling Anders Hejlsberg’s newest creation: TypeScript, a superset of Javascript aimed at making the language’s big jobs easier. Key features of TypeScript include:
- module support
- class declarations
- static typing
- a Visual Studio 2012 plugin
S. Somasegar, corporate vice president of Microsoft’s Developer Division, writes:
During the past five years, JavaScript speed has doubled every nine months (as measured by the WebKit SunSpider JavaScript benchmark.) With HTML5, the standard web platform has become significantly more compelling for delivering rich user experiences. At the same time, the reach of JavaScript has continued to expand, going beyond the browser to include native device apps (e.g. Windows Store apps for Windows 8), applications in the cloud (e.g. node.js running on Windows Azure), and more. With these developments, we’re starting to see applications of unprecedented size written with JavaScript, despite the fact that creating large-scale JavaScript applications is hard. TypeScript makes it easier.
Somasegar went on to state that “All Javascript code is TypeScript code” -- so any Javascript framework or
library should work with TypeScript, and any line of Javascript entered into
TypeScript’s compiler should run as expected. The source code for that compiler
is available now, and Microsoft has made
TypeScript available on Codeplex under an Apache 2.0 open-source license.
TypeScript prioritizes syntactical similarity to Javascript, making it much closer to core JavaScript than Dart. And although it compiles into JavaScript like CoffeeScript, TypeScript seems less interested in encouraging Javascript best practices; TypeScript is all about adding functionality and making large scale JavaScript applications.
What I think is most interesting about TypeScript is the fact that it draws heavily on specs from the ECMA committee's next iteration from JavaScript -- so TypeScript is like a tool for using JavaScript the way we'll be able to in the future, when the new standards finally catch up.
You can watch Anders Hejlsberg introduce TypeScript here:
So what do you think? Will you be using TypeScript to develop Javascript apps? Does it seem more compelling than CoffeeScript or Dart, or roughly the same?
Comments
Mark Unknown replied on Tue, 2012/10/02 - 8:33am
I might use it. The biggest drawback is that there is no Eclipse/Netbeans/IntelliJ plugin. Yet.
I am very interested in Dart, but i am concerned about its future. So that would apply somewhat to TypeScript. But something needs to make JavaScript 'better'.
Gusts Kaksis replied on Tue, 2012/10/02 - 9:33am
Pavel Savara replied on Wed, 2012/10/03 - 4:11pm
@Mark, vote here ;-)
http://youtrack.jetbrains.com/issue/WI-13714