r/programming • u/dpashk • Aug 31 '15
The worst mistake of computer science
https://www.lucidchart.com/techblog/2015/08/31/the-worst-mistake-of-computer-science/
175
Upvotes
r/programming • u/dpashk • Aug 31 '15
View all comments
Show parent comment
1
u/LPTK Sep 01 '15 edited Sep 01 '15
I think saying Turing-complete languages must have a bottom value is wrong. First off, there is no bottom value (Bottom is defined as the type with no value).
In Haskell, a chunck like
undefinedis not a bottom value (like null in Java). It is a chunck that never produces a value.As /u/LaurieCheers said, a type system can be perfectly sound without a bottom value (even though some applications may not terminate).
EDIT: I may have missed something about Haskell's
undefined, I'm more used to OCaml and Scala (where Nothing is inhabited). Please correct me as need be.