News for hackers. Stuff that matters.
Re:Are dynamic languages going to replace static languages? ... by lolinder on Wednesday August 04, 2021 @12:09PM (#28062683)
The advantage TypeScript has for front-end over something that compiles to JS is that you pretty much know what your code will compile to: with a few exceptions, you just strip out the type annotations. Knowing this, you can accurately predict things like performance.

In contrast, a compiles-to-JS language can produce code that behaves unexpectedly in its non-functional requirements, and in the worst cases crashes where it shouldn't. That will be less of an issue as compilers get better, and WASM should help a lot, but in the current ecosystem TypeScript produces more predictably good results.

Re:Are dynamic languages going to replace static languages? ... by Zababa on Wednesday August 04, 2021 @12:52PM (#28063295)
That may be true in theory, but I find that people write radically different code in JS and in TS. TS code looks a lot more like C# compared to regular JS code, people use a lot of classes over plain functions and data structures.