Skip to content

TypeScript

by Jesper on October 1st, 2012

TypeScript is JavaScript with types. (See Anders Hejlsberg introduce it.)

TypeScript seems to sit at the halfway point between Dart and CoffeeScript; just enough “full language” to make self-idiomatic use of concepts useful in a type system (classes, inheritance and properties; even interfaces as duck typing “cookie forms”), but works with all JavaScript code and also works as a slightly better JavaScript if all you want are some occasional types.

Compiles down to idiomatic JavaScript and has type erasure. (Where possible, the concepts track upcoming ECMAScript syntax!) Things that would go boom at runtime in JavaScript still go boom at runtime. The same things written using types will go boom at compile-time (or edit-time) and not produce any JavaScript at all. The types are used not to enforce runtime consistency or constitute formal proof but to power productivity tools and to prevent fat-fingering.

Sidecar interface files are available for jQuery, jQuery UI, node.js, the DOM and more. CommonJS modules and AMD modules both supported for consumption and production. The compiler is self-hosted and fully open source.

Still not sold on whether this is the perfect mix, but seems to laudably balance juicing every current aspect of JavaScript for what it’s worth and adding new concepts without requiring the full weekend stay in reprogramming la-la land.

From → TypeScript

No comments yet
Click here to cancel reply.

Leave a Reply

Note: HTML/Markdown is allowed. Your email address will never be published.

Subscribe to this comment feed via RSS

gipoco.com is neither affiliated with the authors of this page nor responsible for its contents. This is a safe-cache copy of the original web site.