Thinking about how to make Go memory safe without using atomics everywhere: 1. Double bounds check slice indexing: i.e. store length of backing store on heap and check it. 2. Box interface types on heap. 3. Implement maps in Go with no unsafe. I think this works?
-
-
This does mean that anything sliceable needs some heap metadata. This might be too difficult in practice. So an alternate solution is to make the (ptr, len, cap) triple immutable.
-
If you were creating Go-like slices in Java, double check is what you would effectively be doing, because the JVM enforces bounds checks on arrays by consulting the underlying allocation.
- 6 more replies
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.