Comment

Comment by noelwelsh

Nah, that's not the issue. The way the game works is this:

1. Decide on some property you want the compiler to enforce for you. E.g. I care about only operating on values that exist.

2. Encode this in the type system. E.g. use the Option type to distinguish those values that may not exist (Options) from those that definitely do (everything else).

It's not about being able to distinguish valid and invalid values, it about getting the compiler to enforce it for you. This is the real power of modern type systems -- not bookkeeping to keep the optimizer happy but getting the computer to check the things you care about.

parent noelwelsh 14 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton