News for hackers. Stuff that matters.
Re:Porting 30K lines of code from Flow to TypeScript by wvenable on Monday January 14, 2019 @08:13PM (#18908107)
> I don't want to fight with the compiler.

The only time you're ever fighting the compiler in a modern statically typed languages with type inference is when you've made a mistake.

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
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.

Re:Porting 30K lines of code from Flow to TypeScript by farresito on Monday January 14, 2019 @10:53PM (#18908745)
Is it really the compiler/type system's fault, though? Sounds more like a language's design or specification flaw.