4 ms·
Pattern matching: Kotlin has a `when` that desugars into if when statements, but it's pretty far from pattern matching like you see in Scala, Swift, and more tr
by jnbiche 9y ago
Pattern matching: Kotlin has a `when` that desugars into if when statements, but it's pretty far from pattern matching like you see in Scala, Swift, and more traditional functional languages.
Recursive data structures: Yeah, for some reason I wrote recursive data structure when I was thinking of algebraic data types, like Scala can encode with case classes. I often use them in Scala or OCaml to make recursive data structures which is why I mistakenly used that term instead of ADTs.
TCO: glad to see I was wrong. Kotlin added support for this in the past year.
Android: I realize that to support Swift on Android, Google would need to do significant work, but they wouldn't have to change the VM since Swift could also be compiled to Dalvik bytecode. But obviously that would be a lot of work. I only mention Swift since there were rumors in the past that Google was considering fully supporting Swift on Android.
Plus, to be clear, you can run Swift on Android now using the native SDK, just not on Dalvik for making GUI apps.
- jorgemf 9y ago> Kotlin has a `when` that desugars into if when statements Actually not. Not now, probably it was the case at the begining of the language. > algebraic data types they removed some restriction of sealed classes in 1.1. So I am not sure this is true anymore. The memory management in Swift is completely different than in Java. That is the main reason you need to make changes in the virtual machine. JVM uses the garbage collector while swift uses reference counter.