Live data from Hacker News

TypeScript: a language for application-scale JavaScript development

typescriptlang.org

51–60 of 316 posts

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

#51
post #32
post #24

http://i.imgur.com/XB3ib.png Oh M$ Oh...

You lost me at "M$". I'd like to think that HN's level of discussion is above that.

Nonetheless, interesting disclaimer text spotted there. Raises a good question... would that text be there because somebody in the industry analyzes your code?

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

#52
post #45

Awesome, great to see this finally released. I'm a dev in FUSE Labs ( http://fuse.microsoft.com ) and we've been dogfooding TypeScript for a while now. I'd be happy to answer any questions about using TypeScript vs vanilla JS, converting a large codebase, etc.

I'm wondering how to make use of an existing object system. We already have a JS framework that simulates classes and inheritance in the Java-style OOP.

If you have a small sample, you could try it out in the playground (http://www.typescriptlang.org/Playground/) and see what TypeScript can recognize. Generally, I've seen TypeScript plays well with other OO forms and gives you intellisense on quite a lot.

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

#53
post #37
post #14

Weird that I didn't spot a friendly list of features.. seems to have some cool ones, like a shortened function expression (from the doc PDF): (x) => { return Math.sin(x); } and modules, which are implemented using the immediately invoked function expression pattern: module M { var s = "hello"; export function f() { return s; } } Syntax seems more clear than CoffeeScript and tool chain will probably shape up better. L…

I like the shortened function form. I played around with CS for a while before going back to JS, but I do miss being able to do something like: var names = people.map((p) -> return p.name); (or something along those lines). Funnily enough, it reminds me of C#'s LINQ: var names = people.Select(p => p.name);

I've written a LINQ style library for TypeScript that allows you to write something like this:

  from([1,2,3]).select(n => n * n).where(n >=2).toArray()
which outputs

  [4, 9]
Hoping to open source it soon.

Edit: typo, n * 2 should have been n * n, sorry for the confusion

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

#54

All of these compile-to-JS efforts are great, and as much as I love things like CoffeeScript I have to say I definitely worry about language fragmentation. JavaScript is full of flaws, but its monopoly in the browser space has brought about one intriguing and welcome side-effect: a VERY efficient market for both employers and employees. It's easy to overlook how important this common denominator has been for everyone…

This same fear of fragmentation is what kept Java from progressing for so many years and look what happened there. Things 'fragmented' by people just switching to other languages. I say roll the dice and see what happens.

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

#56

Awesome, great to see this finally released. I'm a dev in FUSE Labs ( http://fuse.microsoft.com ) and we've been dogfooding TypeScript for a while now. I'd be happy to answer any questions about using TypeScript vs vanilla JS, converting a large codebase, etc.

This is great to hear. I have only just started reading up on TypeScript. But I would love to know if there will be support for a decimal type. I have been following Google's work on Dart and it doesn't look like they will be implementing it last I checked. Such a feature would be a great differentiator.

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

#57

All of these compile-to-JS efforts are great, and as much as I love things like CoffeeScript I have to say I definitely worry about language fragmentation. JavaScript is full of flaws, but its monopoly in the browser space has brought about one intriguing and welcome side-effect: a VERY efficient market for both employers and employees. It's easy to overlook how important this common denominator has been for everyone…

Javascript is dreadfull , and its flaws are counter productive and intolerable. It has good things like closures and first class functions , and that's it. Most of js developpers hate javascript , but are forced to work with it. So they dont care what they use as client language provided it gets the job done. few people cares about Javascript. most of the devs hate it. But the browser as dev plateform is a fact.

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

#59

No list comprehension? No, Thanks.

Would be a good thing to suggest to the team, it is the first release of the language, after all.

In the interim, a simple library like underscore is quite succinct:

  _.map([1,2,3], n => n * n)
With more library support you could even do infinite lists with something like this:

  _.generate(index => 1.0 / index);

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

#60

All of these compile-to-JS efforts are great, and as much as I love things like CoffeeScript I have to say I definitely worry about language fragmentation. JavaScript is full of flaws, but its monopoly in the browser space has brought about one intriguing and welcome side-effect: a VERY efficient market for both employers and employees. It's easy to overlook how important this common denominator has been for everyone…

JavaScript is forever stuck in design-by-committee hell, which dooms it long-term. Developers who do nothing but pure JavaScript and don't at least play around with the other options (Dart, TypeScript, Haxe, CoffeeScript, et al) are just going to be hurting themselves long-term.

It is always a bad idea to tie yourself too strongly to any single language.

Post reply on HN