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

Even better than RAII would be linear types, but it would require a borrow checker to track the lifetimes of objects. Then you would get a compiler error if you forget to call a .destroy() method


no you just need analysis with a dependent type system (which linear types are a subset of). it doesn't have to be in the compiler. there was a proof of concept here a few months ago:

https://news.ycombinator.com/item?id=42923829

https://news.ycombinator.com/item?id=43199265




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

Search: