Jitterdämmerung (2015, Updated 2021)
blog.metaobject.com
blog.metaobject.com
The reality is that ML won, the type inference system in Java is basically the ML type inference system, the JIT is the ultimate JIT for ML-type languages (as in the Hotspot compiler was intended for an ML-type language.)
If you stop trying to be something else and love static methods you can write
maybe(anyObject, x -> x.toString())
and also write maybe(something, x -> x.get("y"), x-> x.asInteger())
out to arity 30 or more if you write a simple code generator that belts out the repetitive code.I can explain to you how the whole thing works much more quickly than anybody can explain the maybe monad works and the Java compiler type inference works pefectly, it even works when "something" is null.
That is how infested Java is with "functional programming" and has a lot to do with how successful it is, it can soak up the entropy of dynamic situations that turn up in some kind of code.
For instance people struggle to write text editors in Rust, just as they struggle to write them in C. The garbage collector is not as fast on average as a custom memory allocator, but how does your custom allocator perform in the worst case?
In Java on the other hand it is about as easy to write a text editor as it is in LISP -- write it all in one file and only use the standard library if you like if you think objects suck, maven sucks, etc.
> the Hotspot compiler was intended for an ML-type language
This is wrong. The JIT came from Self via Strongtalk, a variant of Smalltalk.
"...built on technologies from an implementation of the programming language Smalltalk named Strongtalk, originally developed by Longview Technologies, which traded as Animorphic. "
That's Wikipedia, but I also personally know some of the people involved in Strongtalk who later worked at Sun.