The borrow checker but for ruby.
-
-
-
Replying to @mountain_ghosts @samphippen
I mean you could write RefCell, not that you should
1 reply 0 retweets 1 like -
Replying to @mountain_ghosts @samphippen
IMO the most useful part of the ownership system in Rust isn't even the checking (at least when considering it in the context of a memory safe language like Ruby) it's having a way to express a major piece of your API.
1 reply 0 retweets 2 likes -
Would love an elaboration on “express a major API”
1 reply 0 retweets 1 like -
Are you going to mutate this thing? Are you going to hold onto it? Am I allowed to mutate this thing after giving it to you? Am I allowed to mutate this thing you gave me? Are you going to call `close` on this file/network stream? Do I need to seek back to a previous position?
2 replies 0 retweets 2 likes -
is there any literature on the space of design patterns in rust, illustrating these ideas?
2 replies 0 retweets 0 likes -
https://github.com/rust-unofficial/patterns … has a lot of various patterns, though the questions I gave there are more about ownership than any design patterns. https://gist.github.com/sgrif/102c67c5ae59ce95ce5fd50018067782 … covers how various types in Rust answer them briefly
1 reply 0 retweets 2 likes
Some examples of where being able to take ownership of an argument is really important/helpful are cases like AR attribute assignment (need the "original" value for dirty tracking, have to know you can't mutate it) or use as a key in a hash map (return of hash must not change)
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.