Re: [swift-evolution] Basic element-wise operator set for Arrays, Arrays of Arrays, etc.

2017-02-20 Thread Abe Schneider via swift-evolution
> > Well I was rather thinking of making a Swift-only library (at least at first) > but that would also be available for other platforms e.g Linux or maybe some > day on Windows => also working with reduced performance without the > Accelerator Framework but leveraging it on Apple Platforms

Re: [swift-evolution] Basic element-wise operator set for Arrays, Arrays of Arrays, etc.

2017-02-20 Thread Nicolas Fezans via swift-evolution
> Once such a library were reasonably mature, it would be reasonable to propose it for inclusion in swift proper. I expect this process will take a couple *years*. Yes, I do not expect this to come very quickly either but if no one gets started, that is going to last for even longer ;-) > or the

Re: [swift-evolution] Basic element-wise operator set for Arrays, Arrays of Arrays, etc.

2017-02-17 Thread Stephen Canon via swift-evolution
> On Feb 17, 2017, at 10:51 AM, Xiaodi Wu via swift-evolution > wrote: > > There's nothing, afaik, which stands in the way of that syntax today. The > proposal is to extend the standard library to add syntax for a math library. > The idea of having a core math

Re: [swift-evolution] Basic element-wise operator set for Arrays, Arrays of Arrays, etc.

2017-02-17 Thread David Sweeris via swift-evolution
> On Feb 17, 2017, at 10:51 AM, Xiaodi Wu wrote: > > > On Fri, Feb 17, 2017 at 12:46 PM, David Sweeris > wrote: > >> On Feb 17, 2017, at 10:38 AM, Abe Schneider via swift-evolution >>

Re: [swift-evolution] Basic element-wise operator set for Arrays, Arrays of Arrays, etc.

2017-02-17 Thread Xiaodi Wu via swift-evolution
On Fri, Feb 17, 2017 at 12:46 PM, David Sweeris wrote: > > On Feb 17, 2017, at 10:38 AM, Abe Schneider via swift-evolution < > swift-evolution@swift.org> wrote: > > If I read Nicolas's post correctly, I think he's more arguing for the > ability to create syntax that allows

Re: [swift-evolution] Basic element-wise operator set for Arrays, Arrays of Arrays, etc.

2017-02-17 Thread Xiaodi Wu via swift-evolution
On Fri, Feb 17, 2017 at 12:34 PM, Nicolas Fezans wrote: > > > If you're simply looking for elementwise multiply without performance > > requirements, map(*) is a very succinct spelling. > > Yes, it is (combined with zip), but: > 1) zip map will not enforce same size

Re: [swift-evolution] Basic element-wise operator set for Arrays, Arrays of Arrays, etc.

2017-02-17 Thread David Sweeris via swift-evolution
> On Feb 17, 2017, at 10:38 AM, Abe Schneider via swift-evolution > wrote: > > If I read Nicolas's post correctly, I think he's more arguing for the > ability to create syntax that allows Swift to behave in a similar way > to Numpy/Matlab. While Swift already does

Re: [swift-evolution] Basic element-wise operator set for Arrays, Arrays of Arrays, etc.

2017-02-17 Thread Abe Schneider via swift-evolution
If I read Nicolas's post correctly, I think he's more arguing for the ability to create syntax that allows Swift to behave in a similar way to Numpy/Matlab. While Swift already does allow you to define your own operators, the main complaint is that he can't define the specific operators he would

Re: [swift-evolution] Basic element-wise operator set for Arrays, Arrays of Arrays, etc.

2017-02-17 Thread Nicolas Fezans via swift-evolution
> If you're simply looking for elementwise multiply without performance > requirements, map(*) is a very succinct spelling. Yes, it is (combined with zip), but: 1) zip map will not enforce same size (which shall be done to fail hard early), nor allow to combine with an array of a single element,

Re: [swift-evolution] Basic element-wise operator set for Arrays, Arrays of Arrays, etc.

2017-02-17 Thread Xiaodi Wu via swift-evolution
If you're simply looking for elementwise multiply without performance requirements, map(*) is a very succinct spelling. Performant implementations for these operations like you have in Matlab rely on special math libraries. Apple platforms have Accelerate that makes this possible, and other

[swift-evolution] Basic element-wise operator set for Arrays, Arrays of Arrays, etc.

2017-02-17 Thread Nicolas Fezans via swift-evolution
Dear all, In swift (just as in many other languages) I have been terribly missing the operators like .* ./ .^ as I know them from MATLAB/Scilab. These operators are very handy and do element-wise operations on vectors or matrices of the same size. So for instance A*B is a matrix