logoalt Hacker News

hombre_fatalyesterday at 7:24 PM0 repliesview on HN

Well, a good type system like Rust's lets you make impossible states impossible to enter/represent by the system.

Writing code so that impossible states are impossible is one of the hardest parts of software, so a good type system means that the code compiling means that the software is validated to be unable to represent certain states which is a very high bar of validation.

I suppose in your mind you were thinking of more trivial errors like typos, accessing variables that aren't available in scope, and such.

This is the main reason I use Rust over Go these days. The simplicity of Go was great for when I had to hold everything in my head and write everything myself. Rust makes more sense to me in the LLM era where I can offload more modeling/assumptions/invariants to the type system without having to be a Rust veteran.

The pinned invariants in my plan/spec become first-class invariants in the type system. It's great.