Redmond Review

With TypeScript, Microsoft Embraces and Augments

TypeScript is designed to make JavaScript development scalable, something Microsoft clearly needs if it's to use JavaScript in its own work.

In my September 2012 column, "JavaScript Diplomacy", I wrote about the importance of JavaScript to Microsoft. Now, as if to add an exclamation point to those thoughts, Microsoft has released its new statically typed JavaScript superset, TypeScript. Maybe you were skeptical before, but there should be no doubt in your mind now that Microsoft is serious about JavaScript. And while my September column discussed Microsoft's use of JavaScript as an instrument of outreach, TypeScript may mark the beginning of JavaScript as an internally strategic technology as well.

TypeScript is designed to make JavaScript development scalable, something Microsoft clearly needs if it's to use JavaScript in its own work. But instead of just building some internal tooling to help in that endeavor, Microsoft created something standards-compliant and open source (under the Apache 2.0 license). And TypeScript compiles to nothing more than vanilla JavaScript that's host- and OS-agnostic.

You can learn all about TypeScript by watching an hour-long presentation on it, complete with code samples, by Anders Hejlsberg. The demos in the video make TypeScript concrete and easy to understand. The video also makes it plain that Hejlsberg -- known by many as the father of C#, LINQ and the Microsoft .NET Framework itself -- seems to be very excited about this new project. Meanwhile, Hejlsberg has never, by any outward indication, been a fan of JavaScript. So what gives?

Hejlsberg Can Read the Writing
If you look at his track record, Hejlsberg seems a keen realist. On the one hand, he was the man behind Turbo Pascal and Delphi, the latter of which was rumored to have the code name VBK, or Visual Basic Killer. On the other hand, the subsequent Microsoft dominance over Borland (and the dominance of Visual Basic over Deplhi) was incontrovertible, and helped Microsoft lure Hejlsberg to Redmond. When he got there, he made himself at home, developing technology that supported the Visual Basic visual development model while implementing language and framework concepts that he felt more comfortable with.

Fast-forward to today, and JavaScript is ubiquitous outside of Microsoft. And with the development models for Windows 8 and apps for Office and SharePoint, as well as full-on support for Node.js on Windows Server and Windows Azure, JavaScript is everywhere inside of Microsoft, too.

It's another "if you can't beat 'em, join 'em" moment. But TypeScript has static typing, type inference, classes, modules and a plug-in for Visual Studio 2012 that implements full IntelliSense. Hejlsberg is acknowledging the success and entrenched status of JavaScript but, once more, with something that implements language and framework concepts with which he feels more comfortable. It's déjà vu all over again.

Competition and Cooperation
TypeScript isn't the first open source project attempting to make JavaScript more modern, structured and suitable for large projects. Google Dart has similar ambitions, as does CoffeeScript and a lesser-known project called Opa. But Dart has its own IDE and VM, CoffeeScript isn't really typed and Opa is joined at the hip with MongoDB. TypeScript, meanwhile, is really just a thin outer layer that syntactically and aesthetically stays true to JavaScript itself and, indeed, is highly inspired by the various proposed ECMAScript 6 standards out there today.

Why is Microsoft so keen to be a good Web citizen? Maybe the company sees JavaScript today much as it saw C++ in the early 1990s. C++ had an almost completely Unix pedigree at that time, as did C before it -- all three were developed at Bell Labs, after all. But Microsoft embraced C++ for Windows development and set out to create one of the best compilers for C++ in the industry. When Visual C++ came out, it gave Microsoft major C++ credibility, as well as a better way to get its own work done and innovate further up the stack.

Could TypeScript provide comparable notoriety and opportunity? Maybe, but it needs wider IDE support. The Visual Studio 2012 plug-in and browser-based "playground" are part of a good start, as are the TypeScript sample syntax files for Sublime Text, Emacs and Vi. But I'd also like to see support for Visual Studio 2010, Visual Web Developer Express, WebMatrix and, for the home run, first-class support in Eclipse. It's only with support across the Microsoft ecosystem -- and beyond it -- that Redmond's commitment to TypeScript will be fully evident.

Of course, no matter what Microsoft does, some developers outside its ecosystem will be cautious, even cynical, about TypeScript. The company should soldier on nonetheless, and do its part to make JavaScript as productive as it is pervasive.

About the Author

Andrew Brust is Research Director for Big Data and Analytics at Gigaom Research. Andrew is co-author of "Programming Microsoft SQL Server 2012" (Microsoft Press); an advisor to NYTECH, the New York Technology Council; co-moderator of Big On Data - New York's Data Intelligence Meetup; serves as Microsoft Regional Director and MVP; and is conference co-chair of Visual Studio Live!

comments powered by Disqus

Featured

  • Hands On: New VS Code Insiders Build Creates Web Page from Image in Seconds

    New Vision support with GitHub Copilot in the latest Visual Studio Code Insiders build takes a user-supplied mockup image and creates a web page from it in seconds, handling all the HTML and CSS.

  • Naive Bayes Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the naive Bayes regression technique, where the goal is to predict a single numeric value. Compared to other machine learning regression techniques, naive Bayes regression is usually less accurate, but is simple, easy to implement and customize, works on both large and small datasets, is highly interpretable, and doesn't require tuning any hyperparameters.

  • VS Code Copilot Previews New GPT-4o AI Code Completion Model

    The 4o upgrade includes additional training on more than 275,000 high-quality public repositories in over 30 popular programming languages, said Microsoft-owned GitHub, which created the original "AI pair programmer" years ago.

  • Microsoft's Rust Embrace Continues with Azure SDK Beta

    "Rust's strong type system and ownership model help prevent common programming errors such as null pointer dereferencing and buffer overflows, leading to more secure and stable code."

  • Xcode IDE from Microsoft Archrival Apple Gets Copilot AI

    Just after expanding the reach of its Copilot AI coding assistant to the open-source Eclipse IDE, Microsoft showcased how it's going even further, providing details about a preview version for the Xcode IDE from archrival Apple.

Subscribe on YouTube

Upcoming Training Events