Live data from Hacker News

Announcing TypeScript 1.0

blogs.msdn.com

91–100 of 118 posts

Re: Announcing TypeScript 1.0

#91
post #6

It'd be great if there was a compiler that would compile TypeScript to asm.js [0]. Adding type-safety in TypeScript is only for the programmer -- when you compile it to Javascript, you don't get any performance increase. But, if you could compile it to asm.js, you'd actually get some performance increase out of it. (Note: I don't know much about TypeScript or asm.js, so if what I just said is completely untrue, I'd l…

If the goal is to produce asm.js you can use a language better than TypeScript. Asm.js has not much to do with JS in spirit.

Re: Announcing TypeScript 1.0

#92
post #52

Earlier quoted context omitted.

Agreed, TypeScript is great, but the compiler is excruciatingly slow. I have to segment my app into multiple sub-build areas and only build a subset at a time, which is annoying because I frequently end up making small changes outside of that subset of code. My app is only around 25000 lines of code and a full compilation still takes around 50-60 seconds which, in a JavaScript workflow, is a lot of friction.

I've never actually used TypeScript until today, but just the tutorial code takes forever to compile, this snippet took 2 seconds for example, whaaat?? interface Person { firstname: string; lastname: string; } function greeter(person: Person) { return 'Hello, ' + person.firstname + ' ' + person.lastname; } var user = {firstname: 'John', lastname: 'Doe'} document.body.innerHTML = greeter(user); It's a shame really, be…

It seems there is a minimum time of 2 seconsd to compile anything because even a simple console.log('Hello'); one-liner also takes 2 seconds.

Re: Announcing TypeScript 1.0

#93
post #79

Earlier quoted context omitted.

Care to explain why? To my understanding asm.js is a restricted subset of JS that allows for optimisations to be performed that would not otherwise be possible. In a similar way to how Java bytecode can be interpreted more efficiently compared to a non-compiled language, like Python. With that in mind, sure you could target asm.js with a high level language that requires memory management, but why couldn't you also t…

The default python implementation(cpython) compiles to bytecode before interpreting(the default c implementation of ruby also does this as of 1.9, before that it did straight interpretation). The difference between compiling to bytecode ahead of time vs at run time is more of a packaging difference and probably not the biggest cause of the speed gap between the languages, although I suppose the python import mechanis…

Thanks for the explanation. I am fairly familiar with the Java internals, but I haven't used Python much, and was just using it as an example. I didn't realise that it was compiled to bytecode before interpreting. I suppose it doesn' make sense for any production-ready language to not have at list a JIT compilation system now that I acually think about it.

Re: Announcing TypeScript 1.0

#94

Anders is a really good language designer. Everything this dude touches turns to gold. He was also behind C# and as far as enterprise languages go C# is a joy to work with. TypeScript is the same way. It's all really well thought out and instead of getting in the way the type system actually helps because you can leverage the dynamic aspects of JavaScript during the prototyping phase and then gradually add types as t…

Linq (cough) Delphy (cough, cough)

Is there anything wrong with LINQ that we are not aware of?

Re: Announcing TypeScript 1.0

#95
post #80

Earlier quoted context omitted.

> But isn't it because in the enterprise projects JavaScript code is written by Java/C# developers who think they know JavaScript, while they really don't? No, it is because: - Unit tests have zero value over new features - Project development tends to be outsourced to teams with high attrition rates - Most of the time cheaper developers are what matter - No one cares about quality, because there are no options to ge…

If you're willing to live in sunny SE QLD, Australia, and good at C# as well as JS, get in touch.

Thanks for the invite, it is a bit far from Germany and Portugal. :)

Re: Announcing TypeScript 1.0

#96

We've been using TypeScript for 9 months now on a large project. It's fantastic. There's now way I'll go back to pure JavaScript again. The type system just catches so many defects, and they're of the kind that are hard and boring to find (typos). Plus IntelliSense integration (including jsdoc) is great. On the downside, our project takes some time to compile so we had to build a tool to do it incrementally. Plus it…

Typos account for a significant amount of my javascript debugging. To have both intellisense and compile time checking for this would be a huge time saver.

Alternatively, make less typos. Get something basic set up like jshint in your editor of choice (will warn for unused and undeclared variables), that kinda thing.

Although it's more of a patch. A proper IDE for JS would be neat, but it'd need to support popular DI frameworks and the like.

Re: Announcing TypeScript 1.0

#97

Most significant announcement IMHO: > Today, we're announcing that we will begin taking pull requests for the TypeScript compiler and language service. A relatively-flagshippy MS project becomes truly open source. This is awesome!

You're required to sign a CLA before you can contribute and they only accept pull requests for bugs. Nothing prevents you from forking, but the main repository doesn't look 100% free.

CLA's are good practice in general. It's always up to the maintainers whether they want feature requests.

And as you pointed out, you can always fork.

Re: Announcing TypeScript 1.0

#98
post #60
post #52

Earlier quoted context omitted.

Agreed, TypeScript is great, but the compiler is excruciatingly slow. I have to segment my app into multiple sub-build areas and only build a subset at a time, which is annoying because I frequently end up making small changes outside of that subset of code. My app is only around 25000 lines of code and a full compilation still takes around 50-60 seconds which, in a JavaScript workflow, is a lot of friction.

Agreed, TypeScript is great, but the compiler is excruciatingly slow. This. at least the js one. Maybe VS is bundled with a Typescript compiler written in C# , i dont know,but clearly the javascript one is damn slow.

Visual Studio uses the same compiler written in TypeScript/JavaScript. The Visual Studio integration is done in C# but only for interop with the Visual Studio APIs, there is only one version of the TypeScript compiler.

I know when Palantir was developing Eclipse tools for TypeScript they posted to the Codeplex project regarding performance issues and the team from MS responded with suggestions about caching and only recompiling the minimal targets necessary.

Re: Announcing TypeScript 1.0

#99

The language is nice, but the compiler uses its own lib.d.ts which has all sorts of definitions for browsers and even proprietary MSIE ones. This doesn't make any sense when using TypeScript in any other context (like Gjs, NodeJS, Rhino, Seed, etc.). TypeScript shouldn't assume a browser by default, or at least provide an option for compiling without lib.d.ts.

$ tsc --nolib

Ooh, undocumented features! How nice, thanks =]

Re: Announcing TypeScript 1.0

#100

We've been using TypeScript for 9 months now on a large project. It's fantastic. There's now way I'll go back to pure JavaScript again. The type system just catches so many defects, and they're of the kind that are hard and boring to find (typos). Plus IntelliSense integration (including jsdoc) is great. On the downside, our project takes some time to compile so we had to build a tool to do it incrementally. Plus it…

How recognizable is the code when debugging run-time defects in a browser console?
Post reply on HN