std.math API rework

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Thu Oct 6 18:53:27 PDT 2016


On 10/6/16 12:53 PM, Ilya Yaroshenko wrote:
> Effective work with std.experimental.ndslice and and mir.ndslice.array
> requires half of std.math be an exactly aliases to LLVM intrinsics (for
> LDC).

Why?

> To enable vectorization for mir.ndslice.algorithm I created internal
> math module [1] in Mir. But this is weird, because third side packages
> like DCV [2] requires to use the module too. Also, some optimisation for
> std.complex and future std.exprimental.color would be very ugly without
> proposed change.

I'd love to understand this point better. In particular, how do you 
reconcile it with kinke's assertion that some of these intrinsics simply 
format to C routines?

Our high-level view is that doing efficient work should not require one 
to fork the standard library. On the other hand, the traditional place 
for compiler-specific code is in the core runtime, not the standard 
library. (There is a tiny bit of stdlib code that depends on dmd to be 
fair.)

So I'd like to be reasonably confident the right rocks are put in the 
right places. Have you considered (per Iain) migrating these symbols to 
core.math and then forward those in stdlib to them?


Thanks,

Andrei



More information about the Digitalmars-d mailing list