News for hackers. Stuff that matters.
Re:State of JavaScript 2021 by _fat_santa on Wednesday February 16, 2022 @10:45AM (#30361451)
> JS and TS brought so much happiness to me for years. But I found it extremely difficult to constantly have to "decide" between X and Y.

At least for me it was never a decision once I found TS, TS always got chosen. My spicy opinion in the JS space is that Typescript is better in every single way over Javascript, it is a superior language. Typescript IMO should be merged into Javascript, how anyone develops with just JS anymore (especially larger projects) baffles me.

Re:State of JavaScript 2021 by hajile on Wednesday February 16, 2022 @12:54PM (#30363230)
TS has a lot of DNA from the failed ES4 attempt.

I think we need something quite a bit more radical than Typescript.

We have "use strict" and I think we need to add "use types" too.

In that mode, we need to disallow the more dynamic parts of JS. They add TONS of typing headaches resulting in poorly-typed projects and they hurt performance too.

This could allow for a much more simple type system and allow a path forward where things like type coercion aren't a thing.

Re:State of JavaScript 2021 by potsandpans on Wednesday February 16, 2022 @03:36PM (#30365340)
Couldn't agree more. I want to see a "mostly pure" occurence type system with refinement types and HKTs on a SUBSET of ECMA.