Re:I Want Off Mr. Golang's Wild Ride
by brianberns on Friday February 28, 2020 @02:16PM
(#22445442)
Off topic: I’ve had success explaining the Monty Hall problem by generalizing it to, say, 10,000 doors, where Monty opens 9,998 of them before allowing you to switch. People seem to intuitively understand that it’s extremely likely that the prize is behind the other door.
You'd think that this would make it evident, but every person I've said this to said "no, you still have a 50-50 chance". I just give up after that.
Re:I Want Off Mr. Golang's Wild Ride
by brianberns on Friday February 28, 2020 @06:48PM
(#22447504)
At that point, the only thing to do is set up 20 playing cards and offer them a prize of $100 for every $10 they wager.
Java uses lazy linking, but Java's static type system is sound (modulo some bugs [1]). The Java VM type system is different from that of Java the language, but it is also sound.
[1]: http://wouter.coekaerts.be/2018/java-type-system-broken
One, the Monty Hall problem. You either get it or you will die on a hill of misunderstanding. I've never seen anyone's mind be changed (I had to change my own mind). Statistics are really fucking hard.
Two, that the differences between the Java Language Spec and the Java Virtual Machine spec mean that Java is not quite as statically, strongly typed as you think. There is code that you cannot (re-)compile that runs just fine, for some useful definitions of 'fine'.
To support lazy loading of classes, and reduce inter-version dependency hell, the first invocation of every function is dynamically dispatched, and the result is memoized. It's not Duck Typing, but it isn't link-time resolution either. It's sort of a Schroedinger's Cat situation. Until you open the box it could be anything. The first Generics implementations and later generations of code obfuscators (ab)used the hell out of this. In fact I don't think Pizza (Java 1.1 era generics prototype) worked without it, and some languages-on-the-JVM may have been intractably slow.