|
|
|
|
|
by lolinder
2489 days ago
|
|
Does "if it compiles it's bug free" actually work in practice? I've heard a lot of advocates for Haskell and Rust use similar lines to this, but it seems to me like it can only be true for a limited subset of all bugs. Elm's "no runtime errors in production" claim has a more reasonable-sounding scope. |
|
So if you know how to formulate the problem so it leans heavily on the type system, you can implement something like a binary tree container, and presume it is correct when it compiles.
Following the same parameters bestows rest of the codebase with this robustness.
See for example the ACM article "Ocaml for the masses" by Yaron Minsky of Jane Street for very lucid practical examples https://queue.acm.org/detail.cfm?id=2038036