ndslice summary please

Ilya Yaroshenko via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Apr 13 08:22:37 PDT 2017


On Thursday, 13 April 2017 at 15:00:16 UTC, Dejan Lekic wrote:
> On Thursday, 13 April 2017 at 10:00:43 UTC, 9il wrote:
>> On Thursday, 13 April 2017 at 08:47:16 UTC, Ali Çehreli wrote:
>>> [...]
>>
>> The reasons to use mir-algorithm instead of std.range, 
>> std.algorithm, std.functional (when applicable):
>>
>> 1. It allows easily construct one and multidimensional random 
>> access ranges. You may compare `bitwise` implementation in 
>> mir-algorithm and Phobos. Mir's version few times smaller and 
>> do not have Phobos bugs like non mutable `front`. See also 
>> `bitpack`.
>> 2. Mir devs are very cary about BetterC
>> 3. Slice is universal, full featured, and multidimensional 
>> random access range. All RARs can be expressed through generic 
>> Slice struct.
>> 4. It is faster to compile and generates less templates bloat.
>> For example:
>>
>> slice.map!fun1.map!fun2
>>
>> is the same as
>>
>> slice.map!(pipe!(fun1, fun2))
>>
>> `map` and `pipe` are from mir-algorithm.
>
> It is all good, but I am sure many D programmers, myself 
> included, would appreciate if shortcomings of Phobos are fixed 
> instead of having a completely separate package with set of 
> features that overlap... I understand ndslice was at some point 
> in the `experimental` package, but again - it would be good if 
> you improve existing Phobos stuff instead of providing a 
> separate library that provides better implementation(s).

Work on Phobos is useless for me because when I need something 
and I am ready to write / fix it I have few days, but not few 
months until LDC release. DUB is more flexible, it allows to 
override version with local path for example. Finally, I think 
Phobos should be deprecated and be split into dub packages.


More information about the Digitalmars-d-learn mailing list