News

Microsoft's TypeScript Enables JavaScript App Scaling

TypeScript has been released under the Apache 2.0 license.

Further confirming the increasing importance of JavaScript to the Microsoft development community, the company today took the wraps off of TypeScript, an open-source programming language with the goal of making it easier to use JavaScript to build large-scale applications.

Microsoft Corporate Vice President S. Somasegar announced the new language on his blog. TypeScript was created for a specific reason, he writes: "getting JavaScript development to scale."

TypeScript is a superset of JavaScript that adds mature language features like "type checking and static analysis, explicit interfaces, and best practices into a single language and compiler," Somasegar states.

He noted that any JavaScript can be brought, hassle-free, into TypeScript; "All JavaScript code is already TypeScript code," Somasegar emphasized several times. Interoperability between the two languages is "simple" he wrote. Simple enough, in fact, to allow a copy-and-paste operation between JavaScript and TypeScript.

Much of that interoperability is gained through "declare files," which Somasegar describes as  "a thin shim of type information describing the interfaces expected in the existing JavaScript." This allows existing JavaScript libraries to be used without any code modification, and "enables IntelliSense and compile-time checking for usage of the DOM as well as of libraries like jQuery and WinRT," Somasegar declares.

Those developers who have moved to Visual Studio 2012 have an advantage, since a plugin is already available: the TypeScript for Visual Studio 2012 plugin. It adds static error messages, code navigation and refactoring among other benefits.

Somasegar writes that TypeScript is fully standards compliant and completely cross-platform, being operating system and browser agnostic. It's available under the Apache 2.0 license. Somasegar even went so far as to say that Microsoft would be "open" to submitting TypeScript to the ECMAScript standards body, which controls the official version of JavaScript.

TypeScript represents another move forward in the evolution of JavaScript, which began life as a client-side scripting language for Web browsers. Over the years, it's become an indispensable Web technology, and Microsoft's interest has followed suit. With the upcoming public release of Windows 8, JavaScript has taken on an exalted place, as Visual Studio Magazine columnist Andrew Brust detailed in a recent article:

"Windows 8 applications, of course, can be developed in JavaScript and HTML5; the framework for the forthcoming LightSwitch HTML5 client apps uses JavaScript as its extensibility mechanism; apps (formerly code-named "Agaves") for Office and SharePoint 2013 are written in JavaScript and use HTML as well."

In an indirect way, JavaScript's growing importance to Microsoft can also be seen by the fact that programming language guru Anders Hejlsberg, who helped create C#, Delphi, Turbo Pascal and LINQ, was a primary force behind TypeScript. In fact, he's created a nearly hour-long video, hosted on Channel 9, explaining TypeScript in detail.

About the Author

Keith Ward is the editor in chief of Virtualization & Cloud Review. Follow him on Twitter @VirtReviewKeith.

comments powered by Disqus

Featured

Subscribe on YouTube