I kinda feel like complaints that using indexing over refs is "bypassing the borrow checker" miss the point. That's like complaining allocation "bypasses the stack".
-
-
semantic correctness. For example, compare Rust enums with something Go or Java would have. That Rust requires you to use indexes to implement something like ECS is absolutely a problem with the language.
-
Imagine you had a system where you absolutely, positively would not want to use heap. Something embedded. (I have such a system at work!) Then heap allocation would be a problem with the language, too, in this problem domain.
-
The difference is that absolutely-no-heap systems are an obscure corner of all software and ECS systems are everywhere.
-
My argument is precisely that stepping out of Rust's *default* guarantees is a deliberate feature of the language and not exiting the problem domain. You're right that it's suboptimal that ECS requires this, but I don't think that's the original point.
-
Er, suboptimal that cyclic graph structures require this. ECS systems are array based *anyway*
-
then again, there's a name for "system that automatically manages memory arranged in a cyclic graph structure", and not having one of those is one of rust's big selling points
-
I'm sad we killed Gc<T>, actually.
-
There's scope for both a pure library version (rust-gc exists, it's kinda naïve but safe) and one the compiler helps with via stack maps (I worked on this earlier, but ultimately it was low priority so we never implemented it)
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.