DIP80: phobos additions

John Colvin via Digitalmars-d digitalmars-d at puremagic.com
Tue Jun 9 01:50:13 PDT 2015


On Tuesday, 9 June 2015 at 06:59:07 UTC, Andrei Alexandrescu 
wrote:
> On 6/8/15 8:26 PM, Ilya Yaroshenko wrote:
>> On Sunday, 7 June 2015 at 18:27:16 UTC, Robert burner Schadek 
>> wrote:
>>> Phobos is awesome, the libs of go, python and rust only have 
>>> better
>>> marketing.
>>> As discussed on dconf, phobos needs to become big and blow 
>>> the rest
>>> out of the sky.
>>>
>>> http://wiki.dlang.org/DIP80
>>>
>>> lets get OT, please discuss
>>
>> There are
>> https://github.com/9il/simple_matrix and
>> https://github.com/9il/cblas .
>> I will try to rework them for Phobos.
>>
>> Any ideas and suggestions?
>>
>> Some notes about portability:
>>    1. OS X has Accelerated framework builtin.
>>    2. Linux has blast by default or it can be easily 
>> installed. However
>> default blast is very slow. The openBLAS is preferred.
>>    3. Looks like there is no simple way to have BLAS support 
>> on Windows.
>>
>> Should we provide BLAS library with DMD for Windows and maybe 
>> Linux?
>
> I think licensing matters would make this difficult. What I do 
> think we can do is:
>
> (a) Provide standard data layouts in std.array for the typical 
> shapes supported by linear algebra libs: row major, column 
> major, alongside with striding primitives.

I don't think this is quite the right approach. Multidimensional 
arrays and matrices are about accessing and iteration over data, 
not data structures themselves. The standard layouts are common 
special cases.

> (b) Provide signatures for C and Fortran libraries so people 
> who have them can use them easily with D.
>
> (c) Provide high-level wrappers on top of those functions.
>
>
> Andrei

That is how e.g. numpy works and it's OK, but D can do better.

Ilya, I'm very interested in discussing this further with you. I 
have a reasonable idea and implementation of how I would want the 
generic n-dimensional types in D to work, but you seem to have 
more experience with BLAS and LAPACK than me* and of course 
interfacing with them is critical.

*I rarely interact with them directly.


More information about the Digitalmars-d mailing list