Live data from Hacker News

TypeScript: a language for application-scale JavaScript development

typescriptlang.org

311–316 of 316 posts

Re: TypeScript: a language for application-scale JavaScript development

#311
post #201

Earlier quoted context omitted.

I'm getting the impression that TS is avoiding making too many dramatic changes to JS. Functions that return undefined in vanilla JS would suddenly return whatever happened to be the last statement; likely leading to unexpected behavior.

i wonder how hard it would be for their compiler to catch the opposite case, then - a program using the return value of a function without a return statement. i think that was my most common bug when i was doing javascript programming, because all the other languages i was using at the time had implicit returns.

Closure Tools will let you annotate your functions with a return type; their compiler will catch a function so annotated that lacks a return[0].

[0] http://sixlette.rs/snap/Closure_Compiler_Service-20121003-15...

Re: TypeScript: a language for application-scale JavaScript development

#312

Earlier quoted context omitted.

I heard a kid complaining about Java being slow yesterday. People remember their first experiences for a long, long time after they stop being true.

This kid had a slow experience with Java a long, long time ago?

He's 19 and been programming for one year.

Re: TypeScript: a language for application-scale JavaScript development

#313

Earlier quoted context omitted.

This looks excellent a nice restrained effort. Hasn't fallen into the trap that ActionScript3 did with too much ceremony, and its nice to see a syntactic super-setting approach rather than Dart's. Now what I'd like to see in Javascripts evolution (non backwards compatible): * Subract: Removing parts of the language - let crockford free to rip out the bad parts. * Enhance: Bring in some more taste of Scheme. * Replace…

new scoping for `var`? Like the block-scoped `let`?

Yes.

I'd prefer to change the semantics than introduce new keywords. Of course there are two schools of thought - I favour a small language over backwards compatibility. (And interim tools for migration).

Where I do favour extensions is for expressiveness or performance reasons.

Re: TypeScript: a language for application-scale JavaScript development

#314
post #4

Say what you want about whether this is a good idea or not, it is clear at least part of MS is really serious about open source. * TypeScript is under the Apache 2.0 license [1] * Source is available via git on Codeplex [2] * Installation is as easy as npm install -g typescript [3] Extra bonus coolness: They've provided an online playground like jsfiddle! [4]. [1] http://typescript.codeplex.com/license [2] http://typ…

This looks excellent a nice restrained effort. Hasn't fallen into the trap that ActionScript3 did with too much ceremony, and its nice to see a syntactic super-setting approach rather than Dart's. Now what I'd like to see in Javascripts evolution (non backwards compatible): * Subract: Removing parts of the language - let crockford free to rip out the bad parts. * Enhance: Bring in some more taste of Scheme. * Replace…

What would more "taste of scheme" mean? Do you mean like lexically-shaped macros?

Re: TypeScript: a language for application-scale JavaScript development

#315

It seems to me that the type checking in TypeScript is extremely limited compared to what the Closure Compiler supports. The examples only show simple `fooInstance : Foo` examples, whereas Closure supports function prototype validation and such, a la C. I will need to see more elaborate examples. Granted, there is no documentation that I could find on the website. I understand that this is a "preview," but I disagree…

What's function prototype validation? Can you expand on this?

Re: TypeScript: a language for application-scale JavaScript development

#316
post #12

Earlier quoted context omitted.

The online playground can do live syntax and type checking as well as provide function call hints. That's pretty cool.

and you can also see in realtime the typescript -> javascript compilation as you type your typescript code. pretty cool.

Agreed.
Post reply on HN