Do we need Mat, Vec, TMmat, Diag, Sym and other matrix types?

Sam Potter sfp at umiacs.umd.edu
Wed Mar 14 20:21:15 UTC 2018


On Wednesday, 14 March 2018 at 17:36:18 UTC, bachmeier wrote:
> On Wednesday, 14 March 2018 at 17:22:16 UTC, Sam Potter wrote:
>> Ideally data structures and algorithms covering this would be 
>> in the standard library?
>
> I sure hope not. At least not for a long time anyway. It would 
> be hard to make any progress if it were in the standard 
> library. At this stage functionality is more important than 
> having a tiny amount of code that is written perfectly and has 
> satisfied the 824 rules necessary to get into Phobos.

Sure. The key word in my statement was "ideally". :-)

For what it's worth, there is already an "informal spec" in the 
form of the high-level interface for numerical linear algebra and 
sci. comp. that has been developed (over three decades?) in 
MATLAB. This spec has been replicated (more or less) in Julia, 
Python, Octave, Armadillo/Eigen, and others. I'm not aware of all 
the subtleties involved in incorporating it into any standard 
library, let alone D's, but maybe this is an interesting place 
where D could get an edge over other competing languages. 
Considering that people in Python land have picked up D as a 
"faster Python", there might be more traction here than is 
readily apparent. Just some thoughts---I'm very biased. The 
reality is that these algorithms are equally (if not more) 
important in their domain than the usual "CS undergrad 
algorithms". It's easy enough to use a library, but again, "high 
torque" would seem to point to making it easier.

>
>> This comment is coming from someone who has been sitting by 
>> the edge of the pool, waiting to hop in and check out D as a 
>> replacement for a combination of C++/Python/Julia/MATLAB for 
>> research in scientific computing. Take all this with a grain 
>> of salt since I haven't contributed anything to the D 
>> community. :^)
>
> What has been holding you back from using D? I've experienced 
> no difficulties, but maybe I've been lucky.

Hard to say. Right now I write numeric C libraries using C++ "as 
a backend". I've used D for some very small projects, and my 
feeling is that I'm using C++ as a worse D. I lean heavily on 
C++'s templates and metaprogramming abilities, and it looks like 
I could do what I do now in C++ more easily in D, and could do 
many more things besides. I think what's holding me back now is a 
combination of my own inertia (I have to get things done!) and 
possibly a degree of perceived "instability" (it's totally 
unclear to me how valid this perception is). I haven't tried 
"BetterC" yet, but once I have some downtime, I'm going to give 
it a whirl and see how easily it hooks up with my target 
languages. If it's a nice experience, I would very much like to 
try a larger project.


More information about the Digitalmars-d mailing list