In other words, it avoids "Tony Hoare's billion dollar mistake" in conflating reference types and optional types. Tony Hoare had a gut feeling that it was going to cause code messiness when he made all references reference nullable in Algol W (instead of going through and adding extra type rules and tracking for nulls), but it was a very simple change to the compiler's type checker. It was too hard to resist such a simple change that made the language more flexible, even if it introduced footguns.
In most languages without ML-like type systems, null is treated as a "bottom type", as if it were a subclass of all classes. This violates the Liskov substitution principle and results in an unsound type system.
When I was working on Google's indexing system, I was very excited to hear rumors that Ken Thompson and Rob Pike were working on a new language. When it was unveiled, I was pretty disappointed to learn that it repeated Tony Hoare's billion dollar mistake.
Re:Crystal 1.0 – What to expect
by eyelidlessness on Monday March 22, 2021 @11:12PM
(#26550596)
I think it would be more straightforward to say expressions (/bindings/return types etc) can be null, but not implicitly so, and must be checked for a value before attempting to use the value. Or as a sibling comment said, in TypeScript terms, `strictNullChecks`.
Or TypeScript, for a more well-known example
It's not entirely unlike how algebraic data types with a "None" case work in the ML family of languages.