Live data from Hacker News

TypeScript: a language for application-scale JavaScript development

typescriptlang.org

151–160 of 316 posts

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

#151

Why does everyone want to take all the nice features of javascript, it being so loose and freeform and turn it into Java? I don't need interfaces and classes built into the language. That's why it's so powerful and lightweight. Prototypical! People keep making the same mistakes, if you let them. No thanks.

The static typing is optional. You can be all "loose and freeform" when hacking stuff out, and later add types in to solidify your code and check for errors.

It's the best of both worlds, IMHO.

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

#152
post #57

Earlier quoted context omitted.

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.

Nah, you're generalizing. I know many JS developers and they all love Javascript in one way or another.

Is that not generalizing as well? I'm one that doesn't. But then, you probably don't know me.

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

#153
post #84

This seems similar to the type checking and optimization done by Google Closure Compiler?

The main difference is that the Closure compiler compiles JS->JS, keeping all the type info in jsdoc comments. Typescript makes the typing a first class language entity, which reduces code portability (and toolchain flexibility) in favor of (I assume) readability and maintainabilty. Another huge advantage is that the typescript parser & compiler is written in Javascript. Closure's jscomp is Java, which decreases back…

[deleted]

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

#154

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.

How does it compare to Dart & Harmony (even coffeescript)? I know that is a long answer, but I'd love a bullet point list of how if compares to the other javascript++ languages that have been coming out over the last couple of years.

I'd have to defer this one to the language designers, I'm sure they've done such a comparison.

Per the spec [1]:

  TypeScript syntax includes several proposed features of Ecmascript 6 (ES6), including classes and modules.
[1] http://go.microsoft.com/fwlink/?LinkId=267121

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

#155

Earlier quoted context omitted.

I started doing C# development last year, coming from mostly a Unix/Perl platform, and I'm really glad about the timing because that's when Microsoft got serious about open development. I started doing web apps using ASP.NET MVC3, and this year MVC4 was released as an open-source project[1]. It seems that a bunch of 'young turks' have reached higher management positions in most of the key software development product…

Roughly the same story here. At the risk of sounding like a fanboy, I feel that while most tech BigCos (e.g. Google, Apple) have become more evil over time, MS has actually become less evil, to the point that using their tech (and some major tech at that) is relatively free of any lock-in risk. TypeScript seems very much in line with this trend, and I love it. This is exactly what I wanted - JavaScript but with decen…

How would you otherwise map GET and POST parameters to method parameters? Have you heard fo model binders? With them you can accept a class as a parameter.

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

#156
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 with this way of presenting a tool. When the Closure Library was released, for instance, it was absolutely chock full of API documentation. This is because it was used for real-world projects and extensive docs mattered, even internal to Google.

There is a language specification (PDF, in the source tree) which is encouraging, but where's the manual? " rel="nofollow">http://www.floopsy.com/post/32453280184/w-t-f-m-write-the-fr.... The specification is largely a rewording of the ES5 spec with insertions where the typing additions are important. It will take a good bit for the reader to separate the wheat from the chaff, as they say.

I have more than a sneaking suspicion that this project is essentially a proof-of-concept, and that it is not heavily used at Microsoft. Do you remember "Microsoft Atlas" in 2006, at the height of the JS DOM Library Wars? In the end, they just pushed their developers to use jQuery with some code generation helpers. Microsoft's open-source track record for JavaScript is not impressive, and I think you'd be a damned fool to invest in this technology for any serious project.

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

#157
It looks really good for a first release. The focus on tooling is IMO the most refreshing thing about the project; the playground is great!

I haven't dug much into it yet, but there are a couple of annoyances that i noticed in the playground that i wish will be corrected/alleviated somehow:

- The language is not expression-oriented. Once i got used to the "everything is an expression" mindset in languages like CoffeeScript or Ruby (or every functional language that i can think of) it feels quite tedious to "go back" and remember that, no, now the "if" is not an expression any more, you can't return it, or pass it to a function, or assign it to something. You can use the special syntax of the "?:" operator for an if-expression, but there is no equivalent for "switch", or "try", or "for".

- The type system doesn't seem to support parametric polymorphism. For example, the type of string[]::map is ((string, number, string[]) => any, any) => any[] instead of ((string, number, string[]) => T, any) => T[]. So the value ["hello", "world"].map((s) => s + '!') is of type any[] instead of string[], which would be preferable IMO.

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

#158

This is quite impressive technically, and I think the type-checking feature alone can make it appeal to those making large-scale application in collaborative development environment. I hope this inspires other similar efforts. A quick run-down of features: - It's a superset of JavaScript. So there is no porting effort needed. (With CoffeeScript, you do not need to port if you don't want to.) - compile-time type check…

With reference to AMD and CommonJS modules, the spec has more info [1]:

  TypeScript implements modules that are closely aligned with those proposed for
  ECMAScript 6 and supports code generation targeting CommonJS and AMD module systems.
It also looks like you can consume CommonJS and AMD modules using familiar constructs.

[1] http://go.microsoft.com/fwlink/?LinkId=267121

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

#159

It looks really good for a first release. The focus on tooling is IMO the most refreshing thing about the project; the playground is great! I haven't dug much into it yet, but there are a couple of annoyances that i noticed in the playground that i wish will be corrected/alleviated somehow: - The language is not expression-oriented. Once i got used to the "everything is an expression" mindset in languages like Coffee…

TypeScript will eventually support generics, as per the spec [1]:

  NOTE: TypeScript currently doesn’t support Generics, but we expect to include them in the
  final language. Since TypeScript’s static type system has no run-time manifestation, Generics
  will be based on “type erasure” and intended purely as a conduit for expressing parametric type
  relationships in interfaces, classes, and function signatures.
[1] http://go.microsoft.com/fwlink/?LinkId=267121
Post reply on HN