ndslice summary please

Dejan Lekic via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Apr 13 08:00:16 PDT 2017


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:
>> I haven't played with ndslice nor followed its deprecation 
>> discussions. Could someone summarize it for us please. Also, 
>> is it still used outside Phobos or is Ilya or someone else 
>> rewriting it?
>>
>> Ali
>
> 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).


More information about the Digitalmars-d-learn mailing list