News for hackers. Stuff that matters.
Re:TypeScript 5.0 by dimitropoulos on Thursday March 16, 2023 @01:58PM (#35185646)
for a lot of people it was some combination of:

- Flow has more adoption (it did, for a while, in the OSS sphere)

- Microsoft is evil (remember, this was before everyone was using VS Code and loving it)

- Facebook is awesome (oh, how times have changed...)

- Flow has total type soundness as a goal (from the beginning, and through to today, TypeScript still lists this as an explicit non-goal)

- You literally cannot use React and Flow together (it didn't support JSX for what felt like an eternity and Flow did from the beginning (I think?).

- Flow had exact object types (TypeScript _sorta_ has this today, but most people don't know to turn it on because it isn't in the strict-mode family: exactOptionalPropertyTypes)

- Flow had more features (and was faster)

- DefinitelyTyped didn't exist yet, and it was easier to find types for Flow (but, let's be real, both had nearly nothing compared to today)

Re:TypeScript 5.0 by RyanCavanaugh on Thursday March 16, 2023 @02:08PM (#35185840)
Total type soundness is not a goal of Flow.

For example, array bounds are not considered. Flow considers this program to have no errors, but TypeScript (with the correct option enabled) will:

  let m = [1, 2, 3];
  console.log(m[4].toFixed());
Also, DefinitelyTyped itself launched before Flow (2012 vs 2015), so the timeline on that point isn't right.
Re:TypeScript 5.0 by RyanCavanaugh on Thursday March 16, 2023 @02:36PM (#35186314)
TypeScript tries to be sound too. It wouldn't really make sense to write a type checker if that wasn't your goal. As the person who wrote the "100% soundness is a non-goal" line in the design goals document, that's there to serve the same role as "Flow sometimes has to make a tradeoff" in the Flow docs in terms of clarifying whether or not 100% soundness is a design goal. For both projects, the answer is "no".

It's unfortunate that people have, over the years, decided that just being upfront about this fact means that TypeScript has a vastly different prioritization of soundness than Flow. We don't; both checkers use soundness as the default assumption when designing behavior.

Re:TypeScript 5.0 by dimitropoulos on Thursday March 16, 2023 @02:32PM (#35186249)
> Flow tries to be as sound and complete as possible.

> https://flow.org/en/docs/lang/types-and-expressions/

That's what I was talking about re: Flow.

also, apologies for messing up the timeline on the DT repo. My memory failed me there. Has it been that long?!?

Re:TypeScript 5.0 by throwaway56960 on Thursday March 16, 2023 @02:25PM (#35186138)
TypeScript could be used with React at least since 2015, that's when I first used that combo in production.
Re:TypeScript 5.0 by dimitropoulos on Thursday March 16, 2023 @02:36PM (#35186310)
it's going to be really hard for me to find now after all these years but there's a video somewhere on YouTube of showing their first attempts at getting TypeScript to work with JSX involving lots of special comments that they would compile out with babel or something (it's been a few years, hopefully I remember that correctly). It was pretty extreme (and cool!).
Re:TypeScript 5.0 by alx__ on Thursday March 16, 2023 @02:43PM (#35186425)
As an "old person" it still weirds me out to see Microsoft get so much praise for their open-source developer tools
Re:TypeScript 5.0 by conaclos on Thursday March 16, 2023 @06:35PM (#35189842)
I am still attracted by Flow which seems to have a simpler and stronger type system. However, Flow seems a bit unstable and the lack of support for TypeScript declaration files and widely used TypeScript syntaxes are stopping me from switching to Flow. I opened an issue for bridging the syntax gap between Flow and TypeScript [0]. Flow v0.201.0 renamed `$Partial` to `Partial` making Flow a bit more compatible with TypeScript. I hope it is just the beginning...

[0] https://github.com/facebook/flow/issues/8989