3 ms·
The delete/free bits never made it in, but some related stuff definitely has made its way into the standard library and compiler over time. Span<T> and Memory<T
by kevingadd 6y ago
The delete/free bits never made it in, but some related stuff definitely has made its way into the standard library and compiler over time. Span<T> and Memory<T> provide a bunch of affordances for safely mixing GC and non-GC pointers in the same workflow. Big chunks of the BCL can operate on strings and data at any address in memory now, which is really helpful for high-throughput parsing and streaming.
- throwaway_pdp09 6y agoWhat's an affordance? Is it something with a technical meaning, like pragma?
- Const-me 6y agoOn technical side, I think GP meant stuff like this https://docs.microsoft.com/en-us/dotnet/api/system.span-1.-ctor?view=netcore-2.1#System_Span_1__ctor_System_Void__System_Int32_ https://docs.microsoft.com/en-us/dotnet/api/system.span-1.-c... And this: https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/operators/stackalloc https://docs.microsoft.com/en-us/dotnet/csharp/language-refe...
- throwaway_pdp09 6y agoI know about spans and stackalloc, I mean quite literally does the word affordance mean something technical here that I've not come across?
- Const-me 6y agoI don’t know what you came across and what you didn’t so I can’t answer that question. Technically, spans support affected many parts of modern .NET, both standard library, runtime and even language.
- DominikD 6y agoAffordance means that the interface of something indicates clearly how it's supposed to be used and for what purpose. This is broader term and it applies to physical stuff like door handles or knife grips too. It's intuitive enough which is probably why previous poster was confused about your question.
- throwaway_pdp09 6y agoI've come across the term affordances before, but in this context if they'd been referred to as methods or classes or 'ways for safely mixing...' whatever I'd have got it, no problem. Calling them affordances is correct (technically they are) but made me think there was something vital (edit: perhaps .net related) I was missing. Mind at peace now, thanks all.