top | item 10271577

(no title)

fernandezpablo | 10 years ago

I disagree. Typescript is an excellent example of an optional static type system that works great. It has none of the 3 problems the OP describes: it's fast, it nicely encompasses the whole language and the Definitely Typed repository includes a TON of 3rd party library type definitions.

discuss

order

softawre|10 years ago

How big is your Typescript project? Because when I read the first paragraph of this I cringed and knew where they were going.

We have a medium sized Typescript app (~100k lines), and it takes 7-10 seconds to transpile to JS.

Whenever a change is made, that is 7-10 seconds the watch command is running and I'm not testing my changes in the webapp.

In fact, a slow running grunt watch is why I'm on HN right now in the first place.

fernandezpablo|10 years ago

That's a ton, you're probably not using typescript incremental compilation feature but recompiling your whole codebase instead. Even in that case, 7 seconds for compiling a 100k LOC code base is not even close to what I call "slow".

pjmlp|10 years ago

> Whenever a change is made, that is 7-10 seconds the watch command is running and I'm not testing my changes in the webapp.

Compared with C and C++ build times which are measured in minutes or even hours, 10s is nothing.

maineldc|10 years ago

The article's code base is also ~100K lines (of clojure) and the type checker runs for 2 mins, so it feels safe to say that Typescript's checking is an order of magnitude faster, right?

carterehsmith|10 years ago

"Whenever a change is made, that is 7-10 seconds the watch command is running"

Wait, is that 7-10 sec with "tsc --watch"? Or like, the whole shebang for the production build?

rattray|10 years ago

Have you tried using Webpack instead of grunt? I haven't tried it with TypeScript but it watches incrementally and might be a lot faster.

masterj|10 years ago

It's competitor from facebook (http://flowtype.org/) is also really fast during development as well, even for sweeping changes across big sections of the code base.

rtpg|10 years ago

agreed on TS, we're using it extensively in production to great effect.

I think TypeScript is an extremely impressive tool, and a great example of considering the current environment when designing. The type system can effectively capture pretty much all API designs that see use.

smrtinsert|10 years ago

Following some frustrations with cljs, I've gone to Typescript as well. Seems like it will be a more practical fit.