Live data from Hacker News

Announcing TypeScript 0.9.1

blogs.msdn.com

91–100 of 116 posts

Re: Announcing TypeScript 0.9.1

#91
post #9

Earlier quoted context omitted.

Cause it makes it windows only. EDIT: to add, I like the idea of typescript (it's a much smaller step than compared to something like Dart). But their tooling is all around Visual Studio, which ties you to Windows. I don't dislike Windows, but I want my development tools to be cross platform (which is why I like Sublime Text, Eclipse, and similar tools).

> but I want my development tools to be cross platform (which is why I like Sublime Text, Eclipse, and similar tools). Still not sure why you're complaining. There's great support for TypeScript for Sublime, Vim, Emacs, Intellij IDEA and Eclipse. http://msopentech.com/blog/2012/10/01/sublime-text-vi-emacs-... http://blog.jetbrains.com/webide/2013/02/typescript-support-... http://marketplace.eclipse.org/content/typesc…

This seems a little disingenuous. I bet Intellij already has great support, but the top link you give there for Sublime Text, emacs and vim doesn't really give anywhere near the level of support you get in Visual Studio. Literally just syntax highlighting! In Visual Studio you get at least error highlighting/completions/code generation/navigation/refactoring.

There are definitely attempts to bring the language service to other editors but when I tried them last (just before the 0.9 release) they seemed either featureless or very slow. If someone can recommend one for sublime/emacs/vim that they actually use I'd be very appreciative!

EDIT: related thing that annoyed me: the language service is part of the TypeScript repo but as far as I can see from there is no official documentation on how to go about leveraging it for other editors! I admit I can kind of understand this until the language is less of a moving target. The best way to get started for now seems to be looking at third party efforts like https://github.com/clausreinke/typescript-tools.

Re: Announcing TypeScript 0.9.1

#92

I haven't heard much about TypeScript since its original announce. Are any big projects using it? Does anybody have some commentary on their experience using it and where they think the project is going?

We built Kangaroom (http://kangaroom.co.uk/) entirely using TypeScript. There are tens of thousands of lines of code.

The optional typing ability is a life saver when your code base grows. We've used the integrated tooling with Visual Studio which also helped a lot.

Microsoft is promising it will be kept in sync with ECMAScript 6, so we don't really think there is much risk in using it. It's definitely helped with productivity, and the learning curve isn't high for JavaScript developers.

Re: Announcing TypeScript 0.9.1

#94
post #51

Earlier quoted context omitted.

Static typing means automatic language-integrated type-checking unit tests. I would bet a lot of dynamic language unit testing has to do with compensating for the lack of proper type checking. It's just like using patterns compensates for lacking language features.

I don't like to think about type checking as unit tests because they approach the problem from a fundamentally different direction, and I worry conflating them could lead to writing the sort of bad unit tests people are talking about here. Type checking, or static analysis in general, checks for the presence of a particular class of errors. Unit tests check for correct behaviour, and in doing so imply a lack of any e…

I understand your point, thanks.

Re: Announcing TypeScript 0.9.1

#95

Earlier quoted context omitted.

> but I want my development tools to be cross platform (which is why I like Sublime Text, Eclipse, and similar tools). Still not sure why you're complaining. There's great support for TypeScript for Sublime, Vim, Emacs, Intellij IDEA and Eclipse. http://msopentech.com/blog/2012/10/01/sublime-text-vi-emacs-... http://blog.jetbrains.com/webide/2013/02/typescript-support-... http://marketplace.eclipse.org/content/typesc…

This seems a little disingenuous. I bet Intellij already has great support, but the top link you give there for Sublime Text, emacs and vim doesn't really give anywhere near the level of support you get in Visual Studio. Literally just syntax highlighting! In Visual Studio you get at least error highlighting/completions/code generation/navigation/refactoring. There are definitely attempts to bring the language servic…

> This seems a little disingenuous. I bet Intellij already has great support, but the top link you give there for Sublime Text, emacs and vim doesn't really give anywhere near the level of support you get in Visual Studio. Literally just syntax highlighting! In Visual Studio you get at least error highlighting/completions/code generation/navigation/refactoring.

It's a little disingenuous to expect environments that are typically more text editor than IDE and much more lightweight (Sublime, Vim, Emacs) to have all the features of an IDE with as new as TypeScript is. Much of those features require much more work than they would to implement in Intellij or Visual Studio, which have great APIs for building plugins with those sort of features[1] even for the community[2].

[1] http://confluence.jetbrains.com/display/IntelliJIDEA/Custom+...

[2] http://plugins.jetbrains.com/plugin?pluginId=5055 (The third party Lua plugin for Intellij for example)

Re: Announcing TypeScript 0.9.1

#96

I haven't heard much about TypeScript since its original announce. Are any big projects using it? Does anybody have some commentary on their experience using it and where they think the project is going?

Yes, ~38,000 lines of TypeScript for my app (https://www.datacracker.com/).

The benefits of inferred typing is great. Mostly you just need to explicitly declare the types of your class properties, and then code that uses the properties or modifies them (like .map() or .forEach) doesn't need explicit types defined - so it still looks like JavaScript.

Refactoring is no longer a search and replace in files (and pray tests pass) affair.

Dealing with other programmer's code is no longer as mentally taxing.

Re: Announcing TypeScript 0.9.1

#97
post #90

Earlier quoted context omitted.

void* is used rarely in practice, apart from perhaps kernel mode or language VM's. I have a 150kloc program in front of me which doesn't have a single void*.

void* is used in practically every C library that offers a callback facility.

Almost...

You have a typed pointer to a function but that's not a void pointer and the "New C Standard" 6.3.2.3 states that you can't cast a function pointer to a void*.

Re: Announcing TypeScript 0.9.1

#98

Earlier quoted context omitted.

void* is used rarely in practice, apart from perhaps kernel mode or language VM's. I have a 150kloc program in front of me which doesn't have a single void*.

Great. That makes more sense. I must have misunderstood what you were saying.

Yes we're not gluttons for punishment believe me :)

Re: Announcing TypeScript 0.9.1

#99
post #5

Earlier quoted context omitted.

My project isn't huge, but larger than it could have been using idiomatic javascript. The scoping with modules and the typing really helped since I'm familiar with C# and having "everything light up" in the IDE. Saved a ton of time letting a compiler catch things instead of writing tests. I tried coffee script, but found the copy/paste option for javascript that I have already written won me over.

Transparent integration with native Javascript is a huge advantage for Typescript over things like Dart, I think. The ability to gradually introduce typing into an existing codebase is going to make adoption so much easier.

That's exactly what I've found. We ported all of our JavaScript code to TypeScript because of this, and are on a hunt to remove 'any' types.

We found a bunch of real and potential bugs due to JavaScript's dynamic nature, particularly with regards to the number of function arguments (JavaScript being happy to ignore extra parameters or replace missing parameters with undefined).

Re: Announcing TypeScript 0.9.1

#100

Earlier quoted context omitted.

Rather than slate me, some constructive discussion would be nice. I'll go from my side: 1. Static type compiler verification saves tonnes of problems. Try managing a 2MLOC dynamically typed solution and you'll get what I mean. 2. Static typed languages are way easier to refactor as more metadata is available to the tooling. 3. Static typed code is easier to test. The type contract is available over the boundary betwe…

5 is not entirely correct. 6 is not true, serialisation in dynamic languages is correctly done with type definitions. 7 is not true at all, mainstream statically typed languages (like C) much more commonly overflow silently. Look at Python, there's no way to lose precision through arithmetic, as types get promoted on overflow correctly. In general, C's type system is so weak as to be both useless and a hindrance.

5 is true for the cases where it results in static compiled output which is equivalent of say C's output.

6 you're adding metadata with type definitions. Enough metadata is present in entirely statically typed languages to not do this.

7. How do you know if 1.000000000000000000001 is decimal or float?

It's weak in some places but strong in others. Knowing when to use each case effectively is the art.

Post reply on HN