Sign in with
Sign up | Sign in

Microsoft Announces JavaScript Rival TypeScript

By - Source: Microsoft | B 21 comments

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."

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.

 

Contact Us for News Tips, Corrections and Feedback

Discuss
Display all 21 comments.
This thread is closed for comments
Top Comments
  • 27 Hide
    cryogenic , October 8, 2012 2:45 PM
    "Microsoft Announces JavaScript Rival TypeScript"

    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...
  • 18 Hide
    digiex , October 8, 2012 2:42 PM
    So may computer languages, so little time...
  • 16 Hide
    A Bad Day , October 8, 2012 3:45 PM
    So, MS, how's your Silverlight?
Other Comments
  • 18 Hide
    digiex , October 8, 2012 2:42 PM
    So may computer languages, so little time...
  • 27 Hide
    cryogenic , October 8, 2012 2:45 PM
    "Microsoft Announces JavaScript Rival TypeScript"

    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...
  • 8 Hide
    booyaah , October 8, 2012 2:56 PM
    I live in a dream world where C# and Java are the native client side languages for all web browsers :) 
  • 2 Hide
    xcaninox , October 8, 2012 3:05 PM
    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.
  • 16 Hide
    A Bad Day , October 8, 2012 3:45 PM
    So, MS, how's your Silverlight?
  • 2 Hide
    leongrado , October 8, 2012 3:56 PM
    Hay yo Microsoft. I'm still using Jscript (not Javascript) at work.
  • 0 Hide
    mayankleoboy1 , October 8, 2012 4:04 PM
    will FAIL.
    Just like Google's "dart" and multiple other scripting languages.



    unless this TypeScript has multiprocessing, its a waste of time.
  • -5 Hide
    willard , October 8, 2012 4:17 PM
    Needs more JQuery.
  • -5 Hide
    techslave3 , October 8, 2012 5:03 PM
    All this before Microsoft announces its competitor to the power button. How surprising.
  • 5 Hide
    Fire-Dragon-DoL , October 8, 2012 5:43 PM
    Quote:
    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.
  • -1 Hide
    fearless1333 , October 8, 2012 6:09 PM
    So first MS makes C# as a rival to Java and now it makes TypeScript as a rival to JavaScript? MS must have an inbred hatred for the word "Java."
  • 2 Hide
    gsacks , October 8, 2012 6:20 PM
    At least they are making it open source. MS seems to have finally learned that open source is not evil incarnate. However they have an uphill climb getting the community to accept this as a sincere effort. MS has a long track record of sabotaging standards.
  • -1 Hide
    Anonymous , October 8, 2012 6:55 PM
    Yes, Microsoft has had a way, with its Visual Studio IDE of leading (with a ring through the nose and thin leather strap) its user in a push you pull me sort of way. Pushing through .net then pulling to WPF, and then on to windows RT, windows has side triped through J#, C#, and a few WEB Soup de jures! C++ unmanaged code, managed code, forms apps, wpf apps, ending with no more windows forms apps, and WPF apps pushed to windows RT apps! And now TypeScript in the front, pushing javacript out the back! I wonder where M$ will lead us to now. with this "friendly offering" designed to pull the developer further towards the M$ dinner plate.
  • 1 Hide
    Anonymous , October 8, 2012 7:36 PM
    My top 10 reasons why TypeScript will be widely adopted: http://www.pursuitofgreatdesign.com/2012/10/top-10-reasons-why-typescript-will-be.html
  • -3 Hide
    svdb , October 8, 2012 8:15 PM
    "TypeScript is compiled into Javascript to ensure compatibility." Ha! Yet another code JS generator...

    Making large JavaScript applications is not a matter of language but a matter of skills. There is no such thing as a "better" programming language to replace experience.

    I can't tell the future and I can't tell if typeScript will be widely adopted or not, but I do know JScript and vbScript weren't.
  • 0 Hide
    cookoy , October 8, 2012 9:33 PM
    Yet another programming language to learn. After reading several For Dummies books on different programming languages, i'm starting to feel like one.
  • -1 Hide
    back_by_demand , October 8, 2012 10:13 PM
    As I read this I started to think that the fanbois will have a field day, "leave teh Java alone!!!" and "you just want a monolpoly" or "I won't use Typescript because it doesn't have a Start menu, lulz!!!"
    ...
    Until I got to the bit where it said
    Quote:
    Microsoft is making the new language open-source

    ...
    OK so they spent good money improving something and now they are giving to the world for free, so all the haters please just STFU
  • 2 Hide
    merikafyeah , October 9, 2012 4:12 AM
    Here's a better article regarding TypeScript:
    http://www.hanselman.com/blog/WhyDoesTypeScriptHaveToBeTheAnswerToAnything.aspx
  • 0 Hide
    saille , October 14, 2012 8:53 AM
    "Microsoft's latest answer to JavaScript ..."?

    Get your facts right, Typescript is far more accurately described as MS's answer to CoffeeScript, not JavaScript because it compiles down to JavaScript. VBScript was their 1990's answer to JavaScript, but with today's MS more hip ;)  and open MS there's no question JavaScript is a first class citizen for a MS developer - and I am being serious - they are not trying to hide the ugly parts away - TypeScript is a thin layer of static typing that can optionally be added as metadata over any existing JavaScript code to enable a more productive developer experience. And its open source.
  • 0 Hide
    Anonymous , October 15, 2012 12:51 AM
    I produced a free TypeScript eBook:

    http://www.heronote.com/files/TypeScript.htm
Display more comments