Re:Manifesto: Adding memory ownership to Swift
by telotortium on Friday February 17, 2017 @02:25PM
(#13670936)
A summary (from the Rust subreddit https://www.reddit.com/r/rust/comments/5unav5/): https://gist.github.com/Gankro/1f79fbf2a9776302a9d4c8c0097cc....
[ Parent
| on HN ]
Re:Manifesto: Adding memory ownership to Swift
by Gankro on Friday February 17, 2017 @03:24PM
(#13671401)
Hit me up with any questions y'all have.
Re:Manifesto: Adding memory ownership to Swift
by solidsnack9000 on Saturday February 18, 2017 @04:51AM
(#13674222)
The Swift ownership system doesn't address concurrency because a mutable reference can be passed to a function, stored somewhere, and then passed to another function?
Re:Manifesto: Adding memory ownership to Swift
by Gankro on Saturday February 18, 2017 @08:56AM
(#13674801)
The major holes are: class fields, globals, and captures of escaping (non-scoped) closures (which are basically class fields).
Although this system proposes dynamic checking for these cases, it's explicitly not atomic checking. Atomic checking would be very expensive even though most code doesn't need it. Also there's a general sense that java, which does atomically guard all shared mutable state, has the problem that these accesses are defined but ultimately useless. Part of this is that coherent updates require coarser locks.
Re:Manifesto: Adding memory ownership to Swift
by solidsnack9000 on Tuesday February 21, 2017 @06:38PM
(#13701340)
Maybe for objects it makes more sense to be able to "own" the object as a whole, if I am understanding you right. Still reading the Swift proposal.