Re:Porting 30K lines of code from Flow to TypeScript
by SmooL on Monday January 14, 2019 @08:33PM
(#18908182)
Or you're trying to do something fancy that the compiler/type system doesn't support
[ Parent
| on HN ]
Re:Porting 30K lines of code from Flow to TypeScript
by wvenable on Monday January 14, 2019 @09:45PM
(#18908503)
If you're doing something so "fancy" that the compiler/type system doesn't support it, you should probably re-think it.
Re:Porting 30K lines of code from Flow to TypeScript
by zukzuk on Monday January 14, 2019 @10:56PM
(#18908761)
Nah, there are still some patterns, especially around metaprogramming, that TypeScript doesn't support. One example is the inability to refer to the current class inside a static method. This makes it really awkward to write things like factory methods, which in turn forces you to either resort to copy & paste coding, or fighting with the compiler. See https://github.com/Microsoft/TypeScript/issues/5863 for example.
Re:Porting 30K lines of code from Flow to TypeScript
by Nimelrian on Tuesday January 15, 2019 @06:05AM
(#18910283)
Higher kinded types are currently not supported by the TS compiler and would be a highly appreciated feature.
Re:Porting 30K lines of code from Flow to TypeScript
by nicoburns on Monday January 14, 2019 @10:51PM
(#18908736)
Perhaps, but if that means doing it in a more cumbersome way, or with mire boilerplate, then that would be an area where dynamic languages have an advantage.
IMO, one of the geeat things about TS is that you can opt out of the type system for specific functions if you really want to.