Welcome to WebmasterWorld Guest from 54.227.96.5

Forum Moderators: bill

Message Too Old, No Replies

Microsoft takes the wraps off TypeScript, a superset of JavaScript

     
5:31 am on Oct 2, 2012 (gmt 0)

Administrator from JP 

WebmasterWorld Administrator bill is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month Best Post Of The Month

joined:Oct 12, 2000
posts:14851
votes: 101


Microsoft takes the wraps off TypeScript, a superset of JavaScript [zdnet.com]

On October 1, Microsoft took the wraps off TypeScript, a new programming language that is aimed at making JavaScript development scale beyond the client.

...

"With HTML5, the standards web platform has become significantly more compelling for delivering rich user experiences. At the same time, the reach of JavaScript has continued to expand, going beyond the browser to include native device apps (e.g. Windows Store apps for Windows 8), applications in the cloud (e.g., node.js running on Windows Azure), and more. With these developments, we’re starting to see applications of unprecedented size written with JavaScript, despite the fact that creating large-scale JavaScript applications is hard. TypeScript makes it easier."
5:42 am on Oct 2, 2012 (gmt 0)

Senior Member from GB 

WebmasterWorld Senior Member brotherhood_of_lan is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Jan 30, 2002
posts:4843
votes: 2


This will cause some controversy I'm sure.

Not being a strictly client-side developer, I still wonder what this "going beyond the browser " means. It sounds like it's an adoption that would better be avoided.
2:38 am on Oct 3, 2012 (gmt 0)

Administrator from JP 

WebmasterWorld Administrator bill is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month Best Post Of The Month

joined:Oct 12, 2000
posts:14851
votes: 101


Agreed. I read that and my brain screamed "security hole!".
10:29 am on Oct 3, 2012 (gmt 0)

Senior Member from FR 

WebmasterWorld Senior Member leosghost is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Feb 15, 2004
posts:6717
votes: 230


From the people who brought you activeX ..;) what could possibly go wrong ? ..
12:19 pm on Oct 3, 2012 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:May 6, 2005
posts:670
votes: 0


TypeScript is a development tool to aid developers in type checking their JavaScript code, and to provide Intellisense for code completion. The idea is that more coding errors will be caught at design-time, not at run-time.

TypeScript operates along the same lines as JSLint. So I guess if you think those types of developer productivity tools are evil, you should stay away from them.

When TypeScript is compiled, it translates into plain old JavaScript. Your browser simply sees JavaScript, and cannot tell if TypeScript was used to create it at design-time. So the only security hole would be in your browser, if it has a buggy JavaScript interpreter/compiler.
1:57 pm on Oct 3, 2012 (gmt 0)

Full Member

10+ Year Member

joined:June 29, 2005
posts:216
votes: 0


The idea is that more coding errors will be caught at design-time, not at run-time.

I agree. Doesn't look to be improving anything for visitors (ie, improving runtime) but rather helping developers write javascript. I know there are a few other tools out there like this, but having the option of being tied into Visual Studio, and including things like the type checking, could make it a winner.

I think the kicker will be how good the javascript is that is generates.
2:19 pm on Oct 3, 2012 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member fotiman is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Oct 17, 2005
posts: 4988
votes: 12


Yeah, TypeScript [typescriptlang.org] basically sounds like a CoffeeScript [coffeescript.org] alternative.
2:41 pm on Oct 3, 2012 (gmt 0)

Full Member

10+ Year Member

joined:June 29, 2005
posts:216
votes: 0


Apparently the main difference between TypeScript and CoffeeScript is that CoffeeScript is a new language that compiles to javascript, where typescript is (to a certain degree) javascript, but with additions, which then compile to normal javascript.

I think what MS were trying to say is that you can write bog-standard javascript in a typescript file and it will work just fine. If you want to use any of the new stuff (classes, etc), then you can do, and it will result in javascript that does that job.

I think that's subtly different to CoffeeScript, but having used neither of them, I can only guess what's better!
7:30 pm on Oct 9, 2012 (gmt 0)

Junior Member

10+ Year Member

joined:June 24, 2004
posts:147
votes: 1


Google does something similar with GWT. GWT compiles Java code into JavaScript.