Hacker News new | ask | show | jobs
by rektide 1362 days ago
Generally a huge positive. With tools like swc, there's really fast compilation & typechecking now. With --watch, the DX is pretty good but yeah sometes has to be restarted anyways.

A couple not so greats:

Typescript has added a lot fo confusion & chaos to the ESM transition. A lot of typescript code is in ESM style, byt if you pull the package, it outputs cjs or what not. TypeScript 4.8- very recent- is the first to actually have a semi-viable Node.js + ESM story going; being a respectably modern package hasnt even really been possible with typescript until just recently. Not fully typescript's issue, but writing a package.json that fully helps consumers is quite difficult, and there's a lot more to grol.woth typescript in the mix. There's such a long long tail of typescript packages that are going to be the long long hold up for getting to ESM cleanly. It's not that hard to change, but awareness is just low, and friction is high while we are still so stuck-in-the-middle. Typescript makes writing code easy, but outputting a good respectable usable library has been impossible & is still not easy. Woe.

I really hope EcmaScript does get type annotations, which could eliminate so much of the need to compile & let typed code just run untyped, elide so many of these difficult transpilation challenges.

Another major issue for typescript is that it is stil so compile-time focused, that type metadata isnt kept intact. It's wild to have such a vast typing system, but to just throw it all out at compile time. To be fair, object metadata in js has been tied to annotations, which has been long long delayed, a huge struggle for the language, so there's not clear targets for how to output type information, but there have been some goes, some works to add runtime type information to typescript & there's so little follow up, so little engagement. All TypeScript feels like such a sharply more limited less useful less ambitious project than what it should be doing, than what a real language+runtime would be. It feels like typescript lives in the shadow of a much more clear & visible greatness.

1 comments

I thought swc still doesn’t do type checking and just strips the type annotations?
Hrrmmm. I've been using the newer Jest testing library releases & they are supposedly powered by SWC. I definitely see some typechecking errors, & assumed this was also swc. But I see little evident in the swc project they've made headway here.

Im not sure what Im experiencing in jest. It's definitely not the same level of typechecking. But there's definitely something there & it's definitely much faster start time. Thanks for writing; Im curious too.