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

It was a good signal to me that you are overthinking into the architecture if that is really required. Rust makes something pretty much impossible in C/C++ possible, but not necessarily easy, and that would be one such example.


> It was a good signal to me that you are overthinking into the architecture if that is really required.

Sure, maybe I don't need to statically guarantee the correct execution of code that could easily just throw at runtime instead, but it sure is a fun hobby.


Lifetime subtyping is normally not much necessary to ensure the correctness, provided that you are working at the sufficiently high level (so, say, std is available) and do have some freedom in the design. It often indicates that you are excessively avoiding heap allocations.


You can't just allocate a Lua coroutine on the heap. Lua coroutines are managed by the Lua virtual machine. So that's one heap allocation "avoided". I don't remember the others off the top of my head but some functions needed to have three lifetimes for various reasons. Not sure if I eventually refactored that out or not, it's been a while. I should get back to it one day when my job isn't nothing but startup crunching




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

Search: