by recursive · 10y ago · 0 comments
Joe Duffy's first implmentation of it is here: https://github.com/joeduffy/slice.net
The more recent work for CoreFX is here: https://github.com/dotnet/corefxlab/tree/master/src/System.S...
This is of course expected for languages which keep piling up stuff but still disappointing.
Span/slice was a much more ambitious type that not only provided fast array segment like access, but also introduced a way to provide typed views into byte[] without the cost of casting or copying memory.
Span<T> is low level enough that they considered calling it Array<T> but decided against it to avoid even more confusion.
If you want to see an example of a API failure it is with System.Tuple<>. That type is effectively being deprecated when ValueTuple comes into the BCL with proper compiler support.
Are you arguing that some people rely on ArraySegment being slow?