On Sunday, 14 June 2015 at 12:18:39 UTC, Ilya Yaroshenko wrote:
std.range has a lot of types + D arrays. The power in unified API (structural type system).
Yeah, I agree that templates in C++/D more or less makes those type systems structural-like, even though C is using nominal typing.
I've also found that although the combinatorial explosion is a possibility, most applications I write have a "types.h" file that define the subset I want to use for that application. So the combinatorial explosion is not such a big deal after all.
But one need to be patient and add lots of static_asserts… since the template type system is weak.
For matrixes this API is very simple: operations like m1[] += m2, transposed, etc.
I think it is a bit more complicated than that. You also need to think about alignment, padding, strides, convolutions, identiy matrices, invertible matrices, windows on a stream, higher order matrices etc…