Feeds

TypeScript 0.9 arrives with new compiler, support for generics

Biggest update yet for Microsoft's JavaScript alternative

5 things you didn’t know about cloud backup

Microsoft on Tuesday announced TypeScript 0.9.0, the latest version of its JavaScript killer alternative web language, which Redmond describes as the "largest update to TypeScript to date."

In addition to the usual assortment of bug fixes and performance improvements, this release includes a number of significant new language features and introduces a new, more scalable compiler architecture, according to a blog post by TypeScript program manager Jonathan Turner.

"This release marks the first step of the 0.9.x series, introducing most of the new capabilities of this series which will be further refined over the next few months based on your feedback," Turner wrote.

Perhaps the most important language enhancement is the inclusion of generics, which Turner described as the feature most often requested by TypeScript 0.8 users. Generics allow you to declare APIs using placeholders for the data types of arguments and return values, allowing for more code reuse with increased type safety.

Type safety is of course one the most important features of TypeScript, which builds on the loosely typed, prototype-based JavaScript syntax by adding optional strict typing and class-based object orientation.

Because TypeScript is a superset of JavaScript, valid JavaScript code is also valid TypeScript code. TypeScript just provides additional language features to enable what Microsoft terms "application-scale" JavaScript programming.

In addition to generics, TypeScript 0.9 introduces a finalized syntax for enumerated types (enums), the ability to overload methods to return values of various types based on the specific constants they're fed as arguments, and new syntax to better support JavaScript and TypeScript modules.

A number of other relatively minor changes to the syntax have also been made that could break compatibility with code written for earlier versions of TypeScript – you can find a list here.

On top of these changes, the TypeScript compiler has been significantly reengineered to provide "a much higher fidelity implementation" of the TypeScript language specification, and to provide better incremental performance when working in IDEs such as Visual Studio.

TypeScript 0.9 already provides much better performance for code completion, error reporting, type information, and various other IDE features, Turner said. Future versions are expected to continue this trend, with the goal of ensuring that IDEs can still provide good performance with code bases of 100,000 lines or more.

On the downside, command-line compilation with TypeScript 0.9.0 is "somewhat slower" than when using the older compiler, but Turner says he expects this to improve significantly in TypeScript 0.9.1.

Microsoft has already rewritten its type information for the JavaScript API and HTML DOM to use the new TypeScript 0.9 language features, and has updated its documentation and code samples, so that developers can start taking advantage of generics and other improvements immediately after they upgrade.

As with previous versions of TypeScript, Microsoft has released version 0.9 under the Apache 2.0 open source license, and it is available for download from the TypeScript site on CodePlex as of Tuesday. ®

Boost IT visibility and business value

More from The Register

next story
The Return of BSOD: Does ANYONE trust Microsoft patches?
Sysadmins, you're either fighting fires or seen as incompetents now
Linux turns 23 and Linus Torvalds celebrates as only he can
No, not with swearing, but by controlling the release cycle
China hopes home-grown OS will oust Microsoft
Doesn't much like Apple or Google, either
Sin COS to tan Windows? Chinese operating system to debut in autumn – report
Development alliance working on desktop, mobe software
Apple promises to lift Curse of the Drained iPhone 5 Battery
Have you tried turning it off and...? Never mind, here's a replacement
Eat up Martha! Microsoft slings handwriting recog into OneNote on Android
Freehand input on non-Windows kit for the first time
Linux kernel devs made to finger their dongles before contributing code
Two-factor auth enabled for Kernel.org repositories
This is how I set about making a fortune with my own startup
Would you leave your well-paid job to chase your dream?
prev story

Whitepapers

Implementing global e-invoicing with guaranteed legal certainty
Explaining the role local tax compliance plays in successful supply chain management and e-business and how leading global brands are addressing this.
Endpoint data privacy in the cloud is easier than you think
Innovations in encryption and storage resolve issues of data privacy and key requirements for companies to look for in a solution.
Scale data protection with your virtual environment
To scale at the rate of virtualization growth, data protection solutions need to adopt new capabilities and simplify current features.
Boost IT visibility and business value
How building a great service catalog relieves pressure points and demonstrates the value of IT service management.
High Performance for All
While HPC is not new, it has traditionally been seen as a specialist area – is it now geared up to meet more mainstream requirements?