2 ms·
I don't have much first-hand experience with Haskell (I pretty much know only what I've read about it), so I'll address only OCaml. Scala does a much better jo
by jorgeortiz85 19y ago
I don't have much first-hand experience with Haskell (I pretty much know only what I've read about it), so I'll address only OCaml.
Scala does a much better job of unifying object-oriented and functional programming than OCaml does. OCaml's OO-system feels tacked on; an afterthought rather than a careful consideration of the original design. In Scala, a function is an object and an object is a function. There are many ways in which the line between functional and object-oriented fades.
The C/Java/Python/Ruby school of syntax that Scala comes from is much more familiar to me than the ML school of syntax that OCaml comes from.
Scala doesn't have the distinction between "+" and "+.":
powerbook58:~ jeortiz$ ocaml
Objective Caml version 3.09.3
# 1 + 1;;
- : int = 2
# 1.0 + 1;;
This expression has type float but is here used with type int
# 1.0 +. 1;;
This expression has type int but is here used with type float
# 1.0 +. 1.0;;
- : float = 2.
Scala has access to any Java library.
That said, I don't want to come across as bashing on OCaml; I'm merely pointing out some differences. OCaml is a great language (that was a joy to learn) and for many applications it can be a better choice than Scala.