2 ms·
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
by valenterry 2y ago
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.