ndslice summary please

9il via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Apr 13 03:00:43 PDT 2017


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.



More information about the Digitalmars-d-learn mailing list