Hacker News new | ask | show | jobs
by planetis 1270 days ago
A borrow-checker isn't the most practical or the only way to provide safety. For example, a string type can have an offset for creating O(1) string slices and point to a shared counter. That way when mutating the string, it creates a fresh copy iff the counter is bigger than 0.

I am working towards this in https://github.com/planetis-m/cowstrings