TypeScript

http://www.typescriptlang.org/

TypeScript offers classes, interfaces, mixins, modules, and generics to help you build robust components.

These features are available at development time for high-confidence application development, but are compiled into simple JavaScript.

TypeScript types let you define interfaces between software components and to gain insight into the behavior of existing JavaScript libraries.

Handbook: http://www.typescriptlang.org/Handbook

=Install= sudo npm install -g typescript

=First program= cat > inheritance.ts

class Animal { constructor(public name: string) { } move(meters: number) { alert(this.name + " moved " + meters + "m."); } }

class Snake extends Animal { constructor(name: string) { super(name); } move { alert("Slithering..."); super.move(5); } }

class Horse extends Animal { constructor(name: string) { super(name); } move { alert("Galloping..."); super.move(45); } }

var sam = new Snake("Sammy the Python"); var tom: Animal = new Horse("Tommy the Palomino");

sam.move; tom.move(34);

tsc inheritance.ts