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

Depends on the precise details, but generally speaking the nastiest problem would probably be the fact that `region analysis + type erasure = sadness`.

For instance, you can't just have all your objects be some opaque thing, you need to know if it holds borrows into other types. On one end you can certainly do runtime checking (basically everything is a RWLock) which is slow and still just crashes at runtime. Or you can maybe do whole-program analysis (slow, weird non-local errors).

As far as I can tell, Rust strikes a really clean balance for region systems. Everything about signatures needs to be declared, and the rest can be locally inferred. But when you use type erasure (runtime vtable-based dispatch) you need to decide whether the erased objects are allowed to contain borrows, and what they borrow, upfront.



Sad to read, but thank you :)




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

Search: