Quansight-Labs / numpy.net

A port of NumPy to .Net
BSD 3-Clause "New" or "Revised" License
131 stars 14 forks source link

Better slicing #1

Closed masonwheeler closed 3 years ago

masonwheeler commented 5 years ago

In readme.md, you mention how C# lacks support for Python-style slicing, so everything's done with string parsing instead.

Have you seen the new slicing support added in C# 8? That introduces new types to handle the begin and end part of slicing, at least, while the third parameter could be easily made an int rather than a string.

Also, have you looked at Span<T> and Memory<T>? As Numpy is supposed to be a high-performance computational library, having support for them would be very nice...

KevinBaselinesw commented 5 years ago

I have looked at that a little bit. Unfortunately I don't think it is really compatible with the underlying numpy logic which is what my tool is replicating. There are hundreds of functions that depend on the core logic of numpy slicing which probably would not work very well with this C# 8 method.

I believe the people who are working on this repository; https://github.com/SciSharp/NumSharp are using that mechanism. I think they are having mixed success with it.