Hacker News new | ask | show | jobs
by PhrosTT 3277 days ago
Won't we stop transpiling everything once ES6 support (& modules) are ubiquitous?

I kind of feel like this is when everybody converted codebases to CoffeeScript and are now stuck with having to undo that...

Yes, I get strong typing has merits - but so does writing the native language.

6 comments

> Yes, I get strong typing has merits - but so does writing the native language.

Naturally. But the merits of strong typing far outweigh those of writing the native language, for me at least. If you have a project of any reasonable size, TypeScript is such a huge productivity boost it's incredible.

I was very sceptical (having indeed been burnt by trying CoffeeScript before) but the comparison doesn't really work with TypeScript. If it died tomorrow and we all decided to go without it, we'd just transpile to JS and be done with it - CS -> JS looks very, very different, but TS -> JS is the exact same code, just with types stripped out.

I think there will continue to be es-next stuff that can be made available - im hoping that one day we will get macros in TS so we can experiment with new features/syntax and a compiler is a great way to do that.

But even if all of that does go away, types outweigh writing without types imo - but you can always take the output of TSC and stop using it going forward, its not obfuscated.

This is just me, but there's no way I ever go back to vanilla JavaScript after having used TypeScript for a year.
ES6 is mostly just syntax sugar and standard library stuff compared to ES 5 just like CoffeeScript. TypeScript is about about static analysis (and required metadata called type annotations in code which allow the analysis).

Big difference is that ES 6 has indeed replicated most solutions of CoffeeScript. However so far I can tell ES won't be ever(?) statically typed and therefore it won't ever(?) solve same problem space as TS.

I won't. TypeScript in particular has made my code much more maintainable and pleasant to work in compared to vanilla JS, even recent versions.
I see a potential end-game being TypeScript becoming the new ECMAScript.
Even in that case it's easy to expect the Typescript compiler to remain in existence for its language services (such as intellisense) alone. (Just as Typescript is already used in "salsa" mode by many IDEs/Editors for providing language services for non-Typescript JS code today.)

That said, you would expect more of a middle ground like Python where Typescript type annotations become syntactically valid in ECMAScript but with no clear semantics at runtime, and Typescript would still be needed to compile/verify type assertions.

There's also the case that transpilers will likely remain test beds for both future features for the language and supporting complicated backwards compatible scenarios.