Go compiler moving from C to Go

Joseph Rushton Wakeling joseph.wakeling at webdrake.net
Sat Dec 28 02:53:35 PST 2013


On 28/12/13 06:53, CJS wrote:
> I don't think anything related to linear algebra belongs in the standard
> library. See here, for example:
> http://forum.dlang.org/thread/rmyaglfeimzuggoluxvd@forum.dlang.org?page=2#post-rfnnzssennvpxcihmcmb:40forum.dlang.org.
> The basic point is that linear algebra libraries are too dependent on hardware,
> available libraries, and implementation details to have any place in a language
> specific standard library.

Thanks for your detailed writeup and reference list there -- it's very useful.

My own take on this is pretty much: let's make sure that there is a nice library 
which is Phobos-compatible -- by which I mean, its licence and coding style 
match what's in the standard library -- and approach any decisions about where 
it belongs on the basis of what gets created.

I imagine that putting in the effort to write a really good linear algebra 
library from scratch in D, with attention to all prior work, would probably be 
very rewarding and an excellent stress test of the language, but would also 
involve far too much effort given that we can bind what already exists.

> But I definitely support a D matrix library getting some love and attention.
> Especially since, if I understood the SciD code correctly when I looked at it a
> month ago, it currently is a nice wrapper for a matrix type and solving matrix
> equations and finding eigenvalues. It lacks support for matrix multiplication,
> addition, etc.. I'm not sure if D's operator overloading is sufficiently rich to
> allow separate operators for matrix multiplication and element-wise
> multiplication in matrix. (Dealing with this is a pain in numpy, the most common
> Python matrix library, as well as in Eigen, a common c++ matrix library.)

I don't see why in principle it shouldn't be doable.  Whether it's possible to 
directly define custom operators for this akin to what MATLAB/Octave have: .+, 
.-, .*, ./, etc. I'm not sure, but it ought to be possible to define some kind 
of DSL/template along the lines of:

     c = ElementWise!("a + b");


More information about the Digitalmars-d mailing list