
TypeScript is Microsoft’s answer to Google Dart. Dart is a completely new programming language with completely new libraries and the option to plug in other libraries. In short, it is very similar to desktop programming languages and has little in common with classic JS, except that it can be compiled into it. As far as I know, Dart will be both a server-side and a client-side programming language.
TypeScript from Microsoft, however, takes a different path. It keeps everything from JS, adds a little on top (for example typed arrays, written like generic collections in C#, interfaces, or the ability to link other *.ts files into a file *.ts) and, above all, it adds type checking, which, combined with Visual Studio’s IntelliSense, is its biggest advantage.
If you want to try TypeScript, download the plugin for VS 2012 or 2013, including the Express editions, from https://www.typescriptlang.org/ .
Installation is easy and very fast. I tried TypeScript in VS Express for Web 2012, but it would not compile to JS automatically. Even though I had already started writing a program that would compile only new or changed files to JS based on a hash or file size, this time I wanted it to happen on its own in VS.
So I installed Visual Studio Express for Web 2013, which, however, would not even highlight TypeScript syntax. In fact, with a .ts file open, the whole editor behaved as if it contained plain text .txt.
(Note: the original text is missing a paragraph here describing the installation of the compilation package for *.ts files.)
Just watch out for the path: replace 0.9 with the name of the folder you actually have in that directory. If you already have a <Target Name="BeforeBuild">, just insert the new <Exec> into it. From then on, every time before the website is compiled, the *.ts files marked with Build Action set to TypeScriptCompile will be compiled into files with the same name, in the same folder, just with the .js extension. Let me also show you the TypeScript and the generated JavaScript:
TypeScript -> https://pastebin.com/HH36rX30
JavaScript -> https://pastebin.com/T7xTf0dG
And the best part is that there are already fine-tuned classes from DefinitelyTyped. They contain no code; they serve only to be imported into a *.ts file and then to power IntelliSense. This means you can use, for example, jQuery or plenty of other JS libraries in *.ts files.
You can find the DefinitelyTyped files at https://github.com/DefinitelyTyped/DefinitelyTyped . This was just a quick overview of TypeScript. If you need any help at all, leave me a comment. I will be happy to help.