Typescript - Latest Scripting Language
In this article, we are discussing the latest scripting language from Microsoft which is built on Javascript.In this article we are discussing the features and advantages of Typescript, differences between Typescript and other scripting languages like Dart, Coffeescript e.t.c.
Introduction to scripting languages
Scripting Languages are the programming languages which are designed for communicating and integrating with other programming languages.A programming language ,which is compiled first and then run, where as scripting languages are interpreted ones one command at a time.The programs written in scripting languages known as scripts can be deployed anywhere like web applications etc. Javascript is the best example for scripting languages which is used extensively to create dynamic web pages.
Why are scripting languages important
applications and tools are better served by scripting languages.
main usage areas for scripting languages:What is Typescript and why we need it
TypeScript is a language which is built for application-scale JavaScript development for large applications.We can say typescript is a typed superset of JavaScript which compiles to plain JavaScript.Typescript runs on any browser ,any host. any OS .
Why Typescript ?
TypeScript was built to help enhance JavaScript tooling support and to also help developers manage larger application scale JavaScript projects.
The fact about JavaScript is that Javascript is not application-scale and it is a simple scripting language which does not support structuring mechanisms
like classes, modules and interfaces.There is a need for Javascript which is better and supports all the thing which supports application-Scale. Features of Typescript
define interfaces between software components through which we can get the behavior of JavaScript libraries.Typescript Vs other scripting languages
Typescript Vs Dart
TypeScript doesn't have any interops issues with Javascript because it is build on JavaScript only where as Dart is a native virtual machine written from scratch and interops with JavaScript.
Typescript Vs Coffeecript
TypeScript is a superset of JavaScript and built on top of JavaScript where as CoffeScript provides an alternative syntax which compiles to JavaScript.In typescript with static type system,which allows IDEs to do static analysis and do stuff like type-check warning, statement auto-completions, and refactoring.Typescript advantages
We are aware that with VS.net or any other IDE that it is not always easy to develop and debug JavaScript With the help of static typing annotations and other features in TypeScript which allows VS.net to improve the development experience with JavaScript without any changes in our Javascript. With TypeScript it is possible to get more accurate and helpful intelligense/code-completion,
error and syntax highlighting during development and still get standard JavaScript code.
TypeScript's static typing could enable better tooling with warning squiggles, easy statement completion, plus smart refactoring.
It is possible for easy navigation around code, as well as find references, rename, and more.TypeScript is a superset of JavaScript and you write it like you write JavaScript which I like. Any existing JavaScript is already TypeScript.
Conclusion
According to Luke Hoban "CoffeeScript is to Ruby as TypeScript is to Java/C#/C++." yes,It is true that if you love Ruby, you'll enjoy CoffeeScript as it makes the JavaScript more like the Ruby.
The same is true with TypeScript also. It brings useful features into JavaScript in an ultimately compatible and syntax-friendly way using language constructs you're comfortable with.
Microsoft released a developer preview of TypeScript, a new JavaScript-like programming language that is translated into JavaScript so that its apps can be run in any browser. The source code is licensed under Apache 2.0 and can be found on Codeplex.
TypeScript has a syntax that is very similar to JavaScript but adds features, such as optional static typing, that Microsoft programming language guru Anders Hejlsberg says will make it easier for developers to build larger applications. It attempts to address some of the same issues that Google's Dart programming language does, but without a radical departure from JavaScript.
Like CoffeeScript, TypeScript compiles to JavaScript, but that's where the similarities end. Hejlsberg says TypeScript is actually largely based on the specifications of the next version of JavaScript being developed by the ECMA committee.
JavaScript started out as a simple scripting language for the Netscape browser; it was never intended to become a language for building large-scale applications. Yet the rise of the web and HTML5 have made it into the standard language for client-side development, and Node.js has proved to be a popular way of writing JavaScript applications on the server side.
Frameworks like Backbone.js, the heavily venture funded Meteor and Nodejitsu‘s Flatiron are also trying to address the issue of making it easier to develop modern JavaScript applications.
TypeScript (like CoffeeScript) will actually work with existing frameworks and libraries — any JavaScript can just be pasted into TypeScript and should just work.
Hejlsberg created Turbo Pascal, was the chief architect of Delphi, and is the lead architect of C# and LINQ. He developed TypeScript with Steve Lucco and Luke Hoban.
Here's a list of features:
Optional static typing Class declarations Support for modules A Visual Studio plugin