Re:Swift is a more convenient Rust
by valenterry on Friday September 06, 2024 @06:40AM
(#41464836)
OCaml is older than Scala though.
> Java also added the equivalent of sum types with sealed interfaces and exhaustive pattern matching, does that make Java an ML language?
I don't think so. Java heavily relies on mutation and you can see this throughout the whole ecosystem and even the JVM whereas OCaml doesn't. Kotlin also relies on mutation (it relies on Java's stdlib after all) whereas Scala has its own stdlib with both mutable and immutable classes but defaulting to immutability almost everywhere.
So if anything, Scala can be called an ML language imho.
> does that make Java an ML language?
not really, the type-system-sublanguage is still modelled like classy OOP, not more like MLy modules.
Re:Swift is a more convenient Rust
by nextaccountic on Friday September 06, 2024 @06:42AM
(#41464845)
But Kotlin is like this too.
Indeed, and Scala (at least the version I've tried 10 years ago) tries to do both, somewhat poorly. shrug
Re:Swift is a more convenient Rust
by valenterry on Friday September 06, 2024 @07:01AM
(#41464957)
Personally I found Scala's module/import system to be really really good. There are some annoying things with it, but they mostly come from JVM/Java compatibility.
Scala is quite a bit older than the others, I'd put it in a previous generation.
I always saw Kotlin as a more convenient Java, without Scalas heavy tilt towards FP.
Java also added the equivalent of sum types with sealed interfaces and exhaustive pattern matching, does that make Java an ML language?
Many older languages by now have incorporated valuable parts of FP/ML (including Javascript, Java, C++, ...)
Borrowing some concepts from ML doesn't put these languages in the ML family.