Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Yeah, I think the compiler has enough information to do that, in principle. But there is another problem: Rust has the design principle that every language-enforced invariant should be clear just from the function signature. This has at least two benefits: the compiler doesn't have to reason about the code invariants "globally", which might slow and hard to optimize, and the APIs are clearer and the user doesn't have to know implementation details to reason about them.

If there's going to be some concept of purity, according to the same principle, it'd be something that one could know just by looking at the function signatures.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: