Hacker News new | ask | show | jobs
by M8 4084 days ago
If Facebook would agree on using standard Typescript, instead of their own thing, that would be amazing.
5 comments

Typescript isn't a standard though, it's one company's implementation of type-checking for JS. Hopefully, the lessons learned from Typescript, Flow, Dart, etc. will be fed back into the TC39 committee and be used to inform an actual standard for optional types in a future version of EcmaScript.
At that point, is think typescript should basically become the official next version of javascript (with the added modification to have things like import work in a browser).

That would save everybody time. Imagine google, facebook and microsoft agreeing on that, and i think it wouldn't take more than 6 months to see it working in chrome, internet explorer and all the other major browsers would follow.

With the new microsoft, and now facebook and google talking to each others, this is the first time something like this could actually become a reality.

As pointed out in their discussion, TypeScript is closer to C# while flow is closer to ML. Those type systems are very different. Considering how functional JS tends to be, I suspect that something based on Hindley-Milner inference could be a great match.
As long as typed syntax of Flow and TypeScript are compatible, it doesn't matter what they do with Flow.

There are things Flow gets right compared to TypeScript. For instance requiring to check the nullness when using the question mark type e.g. `SomeType?`.

They are not compatible in one quite important area. Declaration files syntax for external modules is different for flow and typescript.
It is worth noting with the structural support they have for bare js classes (or really just the js equivalent of classes since they are really just syntactic sugar); React can handle Typescript just fine.
If Angular 2 will adopt Flow as replacement for rtts, it will be amazing.