That isn't rhetorical.
That isn't rhetorical.
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.
That said, I don't mind languages like Haskell where imperative programming doesn't fit in well conceptually. It's just that I wouldn't use languages like that for everything.