DIP80: phobos additions

Manu via Digitalmars-d digitalmars-d at puremagic.com
Tue Jun 9 09:17:55 PDT 2015


On 10 June 2015 at 01:26, Ilya Yaroshenko via Digitalmars-d
<digitalmars-d at puremagic.com> wrote:
>
>> I believe that Phobos must support some common methods of linear algebra
>> and general mathematics. I have no desire to join D with Fortran libraries
>> :)
>
>
> D definitely needs BLAS API support for matrix multiplication. Best BLAS
> libraries are written in assembler like openBLAS. Otherwise D will have last
> position in corresponding math benchmarks.

A complication for linear algebra (or other mathsy things in general)
is the inability to detect and implement compound operations.
We don't declare mathematical operators to be algebraic operations,
which I think is a lost opportunity.
If we defined the properties along with their properties
(commutativity, transitivity, invertibility, etc), then the compiler
could potentially do an algebraic simplification on expressions before
performing codegen and optimisation.
There are a lot of situations where the optimiser can't simplify
expressions because it runs into an arbitrary function call, and I've
never seen an optimiser that understands exp/log/roots, etc, to the
point where it can reduce those expressions properly. To compete with
maths benchmarks, we need some means to simplify expressions properly.


More information about the Digitalmars-d mailing list