@jorendorff I have a dumb Rust question... Does the "no mutable aliases" rule mean I cannot "soundly" use Rust instead of C++ for all my programming tasks? It'd be simplifying if I knew in my head I could always replace C++ with Rust for all use cases.
I’m not super familiar with the GTK bindings, but I think that in GTK you don’t reach inside objects much. Instead you use accessor/mutator functions.
-
-
So the "out" is to define a shim & do all FFI calls for the objects, if I'm understanding right, then you don't need to worry because the FFI call sequence can't be optimized via the assumption "shared mutable objs don't alias"? (Vs poking around in non-opaque structs via Rust)
-
More or less, that’s how it works. Note that Rust doesn’t make any aliasing assumptions about unsafe *mut pointers, though, so you always have a direct “out” that way.
- 6 more replies
New conversation -
-
-
So the issue only comes up if you’re actually writing GTK+ objects in Rust. In that case you need runtime enforcement of alias xor mutable. There are various ways to do that.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
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.