News for hackers. Stuff that matters.
Re:Safe zero-copy operations in C# by algorithmsRcool on Tuesday September 30, 2025 @09:55AM (#45425489)
Isn't Span<T> the exact same concept?
Re:Safe zero-copy operations in C# by titzer on Tuesday September 30, 2025 @10:47AM (#45426152)
Conceptually they are almost identical, though Virgil has explicit source syntax for making a subrange. One important difference, according to [1] Span<T> can only live on the stack. There are no lifetime restrictions for Range<T> in Virgil.

[1] https://learn.microsoft.com/en-us/archive/msdn-magazine/2018...

Re:Safe zero-copy operations in C# by achandlerwhite on Tuesday September 30, 2025 @12:00PM (#45427192)
Memory<T> is the heap compatible version of Span<T> in C# for anyone curious.