4 ms·
It’s part of the standard library, not the language, so it’s not really a cost to the compiler. And this just uses all the same rules as normal Rust code, so l
by steveklabnik 3y ago
It’s part of the standard library, not the language, so it’s not really a cost to the compiler.
And this just uses all the same rules as normal Rust code, so like, sure, to use features you have to know them, but I find it a bit silly to frame that as a “cost.” If that’s a cost, so is literally everything.
Anyway my main point is just that you have less refount traffic than in other implementations.
- hu3 3y agoIf were going down the calling silly route, I'd rather categorize handwaving of Rusts additional complexities by their community as silly. If "everything has a cost" anyway we might as well code is assembly for optimal performance. But no, because nuances and differences of cognitive load during development can be significant. And so does compilation speed. It's arguably much easier to code with a GC and language adoption reflects that.
- cesarb 3y ago> I'd rather categorize handwaving of Rusts additional complexities by their community as silly. I believe what steveklabnik meant, was that all this extra complexity (the borrow checker) already exists in the language for other reasons. It's not an additional cost to the compiler or the developer when using the reference-counted types (Rc or Arc).
- steveklabnik 3y agoThat's correct. I thought we were talking specifically about refcount traffic, not about broader issues.