As much as I dislike Java (ML outclasses it as a language), that's probably much better than the obvious alternatives (C and C++): there aren't nearly as many undefined behaviours, and that eliminates a whole class of potential security vulnerabilities.
If it were written now, Rust could be a viable alternative: just as safe, potentially faster, with less dependencies (at least as far as the compiled binaries are concerned).
>ML outclasses it
you people are why nobody will
take haskell or ocaml seriously.
as a developer who works primarily with haskell: it is not a panacea, stop being so snobbish
I did not say ML was a panacea. I said it was better than Java. As a language, to be more precise: I disregarded tooling, libraries, and community.
Now as a language, I maintain that ML is better than Java on pretty much every account. It has sum types (or algebraic data types), a safer type system (without null), better generics (that weren't bolted on after the fact), a fine module system, easier lambdas… Ocaml in particular even has a class system, though it is almost never used: ML hardly ever need inheritance, so I count that as a negligible disadvantage. And of course, polymorphism (the OO kind) is easily obtained with with modules or plain higher-order functions.
Yes, yes, Java has an enormous community, loads of tools, and so many libraries that whatever you want to do has probably already been done. Yes, yes, it means that many projects would be cheaper and faster to write in Java, thanks to those libraries, communities, and plain available programmers. The JVM itself is pretty amazing, with a tunable garbage collector, and very fast execution once the JIT has warmed up.
While important, none of those advantages come from the language. They come from Sun, the staggering amount of working Java devs, and the heap of work they already accomplished. Network effects, mostly. A similar comparison could be made between C++ and Rust, though I don't know Rust well enough to have an actual opinion.
---
Also, "you people" should also admit that a language can be better than another, even if it's only Java8 vs Java7, or C++11 vs C++98. You should also realise that it's important to distinguish the language from the rest (community, tooling, libraries). If you don't, the older language always wins! Of course you wouldn't start a sizeable project in Rust in a C++ shop. Throwing away all the internal libraries and framework, all the training and painstakingly acquired experience? Of course not.
Still, one must not lose the long term picture. At that picture is provided by the language. Because ultimately, everything stems from the syntax and semantics of the language.
(Not sure if that's a praise or a criticism.)
As much as I dislike Java (ML outclasses it as a language), that's probably much better than the obvious alternatives (C and C++): there aren't nearly as many undefined behaviours, and that eliminates a whole class of potential security vulnerabilities.
If it were written now, Rust could be a viable alternative: just as safe, potentially faster, with less dependencies (at least as far as the compiled binaries are concerned).