3 ms·
> things like `people.pick('name').capitalize().sort()` With substructural types, the programmer can tell the compiler that a specific value is meant to be use
by catnaroek 11y ago
> things like `people.pick('name').capitalize().sort()`
With substructural types, the programmer can tell the compiler that a specific value is meant to be used only once. For instance, the `self`-arguments to `.capitalize()` and `.sort()` can be modified in-place, if only the compiler actually knew that it won't be used elsewhere.
> The "sufficiently intelligent garbage collector" is a creature just as mystical as the "sufficiently intelligent compiler".
The real myth is that a “sufficiently intelligent compiler” can figure out what you really mean without you telling it. Compilers are often better than programmers at identifying opportunities for optimization, as well as correctly carrying them out, but the validity of these optimizations often depends on preconditions that compilers can't figure on their own - the programmer must tell them.
Fortunately, the science of systematic, reliable and truthful communication between programmer and compiler already exists: https://en.wikipedia.org/wiki/Type_theory https://en.wikipedia.org/wiki/Type_theory