3 ms·
Is Kotlin's type inference and destructuring more powerful than what they describe in the tutorials? I have only spent a little time with it, but my take-away w
by bunderbunder 9y ago
Is Kotlin's type inference and destructuring more powerful than what they describe in the tutorials? I have only spent a little time with it, but my take-away was that it had much weaker type inference (more similar to C#'s than ML's), and its version of pattern matching was rather limited compared to what you get in ML. And most of the rest of that feature list is also shared with Java.
Moreover, as far as language-defining features, it's hard to ignore how OO the type system is. Working with Kotlin, you won't be dealing exclusively with algebraic types and modules; you'll be dealing heavily in classes and interfaces and extension methods and all that.
For similar reasons, I hesitate to call Scala a true ML descendant. It takes a lot of obvious inspiration from ML, but the standard libraries are all intensely OO in their idiom, the type inference is still quite limited, etc. You can program in a very functional style in Scala if you want, but Odersky is pretty explicit about that not being what he was really about, and if you want to have a good time of it you'll want to be importing Scalaz or Cats rather than relying too much on the standard libraries.
- kod 9y agoActually Odersky has been pretty explicit about Scala being related to OCaml, which is certainly a true ML descendant. https://twitter.com/odersky/status/598224956636450816 https://twitter.com/odersky/status/598224956636450816