OT - Replacing strings with slices in C# - high performance improvement

Steven Schveighoffer schveiguy at yahoo.com
Sat Apr 21 19:15:58 UTC 2018


On 4/21/18 2:37 PM, Seb wrote:
> On Saturday, 21 April 2018 at 16:08:13 UTC, Steven Schveighoffer wrote:
>> On 4/20/18 8:27 PM, Jack Stouffer wrote:
>>> On Friday, 20 April 2018 at 16:33:44 UTC, rumbu wrote:
>>>> .NET Core 2.1 was announced, with emphasis on using Span<T> instead 
>>>> of classic String class all around the framework. For people not 
>>>> familiar with C#, Span<T> is similar to a D array slice.
>>>>
>>>> https://blogs.msdn.microsoft.com/dotnet/2018/04/18/performance-improvements-in-net-core-2-1/ 
>>>>
>>>>
>>>
>>> And we’re trying to move towards a string library type and away from 
>>> raw slices :)
>>
>> Since when?
>>
> 
> At least 2 1/2 years:
> 
> https://forum.dlang.org/thread/56B1224A.7050309@erdani.com

An RCString could have slicing just like C#.

And it doesn't prevent "raw slicing" with char arrays.

FWIW, I support having a string library type and have been advocating 
for it for years (I'd love to have my char arrays back as arrays of 
chars). But it MUST support slicing to pass muster in D.

-Steve


More information about the Digitalmars-d mailing list