niieani / typescript-vs-flowtype

Differences between Flowtype and TypeScript -- syntax and usability
MIT License
1.73k stars 78 forks source link

Miss important factor: Language services / language server protocol support #38

Open cancerberoSgx opened 6 years ago

cancerberoSgx commented 6 years ago

I don't know about flow but you forgot to mention an important aspect about TypeScript. Is more than a language, is a language server, similar to LSP (https://github.com/Microsoft/language-server-protocol)) but on its own. General users won't use that API, but TS architecture force users to use their server (tsserver) running in the IDE / editor. This new concept although could seem not KISS, I think in part is why TS UX is faster than flow cause server is managing the project. Also as user you can develop a plugin for refactor, suggestion, folding, fixes, etc and it will work out of the box on any IDE supporting tsserver,

Although there are no much plugins today and ts team is advancing slowly in this aspect I think is a good idea. Perhaps in time will be obsolete in favor of LSP, who now . I'm learning how to use TS Compiler API myself because I want refactor plugins like those you have in other strongly typed languages / IDEs ike Java/eclipse (like move this method to this other class) and these are some I have (WIP) https://github.com/cancerberoSgx/typescript-plugins-of-mine/tree/master/typescript-plugin-proactive-code-fixes

In the future, perhaps now, flow could tackle this implementing LSP (probably there is already one) but TS is in advantage because tsserver API is very close to the language and LSP is more generic since it needs to support all. On the other hand, depending on a server for managing the project could have negative consequences in large projects performance IMO

I think this aspect is very interesting in the comparison too.Nice work, keep it up, couple of links:

https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API https://github.com/Microsoft/TypeScript/wiki/Standalone-Server-%28tsserver%29 https://github.com/Microsoft/TypeScript/wiki/Writing-a-Language-Service-Plugin

sibelius commented 6 years ago

Flow has LSP support

cancerberoSgx commented 6 years ago

I know would be interesting to see in which platforms / languages and what's the quality of the implementations.

niieani commented 6 years ago

Indeed, quality of LSP is an interesting factor, so I'd welcome a PR adding the comparison of LSP in both platforms.