5 ms·
A variant of option 4 is to keep track of references you know cannot possibly be shared, and update those by mutation. Compared to reference counting, it misses
by dave4420 2y ago
A variant of option 4 is to keep track of references you know cannot possibly be shared, and update those by mutation. Compared to reference counting, it misses some opportunities for mutation, but avoids the false sharing.
I think Roc is doing this.
- zellyn 2y agoCame here to say this! Last I heard, the Roc folks were still curious to see whether this bet pays off for most/all codebases.
- sitkack 2y agoFor those following along https://github.com/roc-lang/roc https://github.com/roc-lang/roc https://github.com/multikitty/New-Programming-Languages-Showcase/blob/main/Roc%20Programming%20Language.md https://github.com/multikitty/New-Programming-Languages-Show... https://www.youtube.com/watch?v=6qzWm_eoUXM https://www.youtube.com/watch?v=6qzWm_eoUXM
- cryptonector 2y agojq does this. But at the jq language level it looks like mutation creates new values without mutating the old ones.
- rocqua 2y agoTo what extent is this already being done by other functional blanguages that have CoW mutability? This seems like a legal compiler optimization to make in most cases no?
- wittystick 2y agoClean has been doing this for nearly as long as people have been using monads, but it never got the attention Haskell did, which I think is quite unfortunate. Rather than implictly keeping track of references, uniqueness types are marked explicitly to inform that their values cannot be aliased. They can also be used with monads to improve ergonomics a bit. Granule has uniqueness types like Clean built onto a linear type system, which offers some additional advantages.
- projektfu 2y agoIs Clean being used anywhere? Last time I looked at it was 1999 and, while cool, I haven't ever heard of anyone using it.