News for hackers. Stuff that matters.
Re:Kotlin is like TypeScript by realharo on Friday May 19, 2017 @04:54AM (#14373883)
TypeScript has structural typing, that is a HUGE difference.
Re:Kotlin is like TypeScript by boubiyeah on Friday May 19, 2017 @05:29AM (#14374028)
Yes, that would be its biggest differentiator.

Scala has it too indeed, but it's not the default mode and feels awkward, also has known limitations.

The nice thing with typescript is that structural typing makes sense for 90% of the use cases, and for the remaining 10%, you can very easily simulate nominal typing by adding a field like so:

interface Robot { __Robot: true }

Re:Kotlin is like TypeScript by realharo on Friday May 19, 2017 @05:48AM (#14374117)
>interface Robot { __Robot: true }

I would much prefer if they just added a new keyword to the language, instead of hacks like this.

https://github.com/Microsoft/TypeScript/issues/202

Re:Kotlin is like TypeScript by seanmcdirmid on Friday May 19, 2017 @04:56AM (#14373889)
Ya, I'm not away of any other popular OO language that goes this route. The implications of structural sub-typing are huge, though I guess many programmers wouldn't be able to call it out.
Re:Kotlin is like TypeScript by atemerev on Friday May 19, 2017 @05:21AM (#14373987)
Scala has it. With Shapeless, you can go all crazy with it.
Re:Kotlin is like TypeScript by rounce on Friday May 19, 2017 @05:09AM (#14373941)
Uhh, JavaScript (via FlowType)?