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

Managed pointers are fine. The only problem I see is ~str and ~[] are managed pointers most of the time and that makes the code looks weird to people.

If we make str default to managed rather than ~str, and [] default to managed rather than ~[], most of the weird pointer complaints will go away.

Edit: Darn, what was I thinking? I meant owned pointer.

Strings or vectors are owned in most cases. That makes Rust code littered with ~str or ~[], especially when having vector of strings or vectors of vectors. ~[~[~str]]. If we make str and [] default to owned, the code would be much cleaner.

That means move the syntax for fixed vec to something else, like ![1,2,3]



I'm not sure what you mean. "String literals" are &str, not a managed string, and [1, 2, 3] syntax creates a fixed-length vector, not a managed one.


Neither ~str nor ~[] are managed. Neither of those introduce any runtime overhead.




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

Search: