D for scientific computing

Stephan stephan_schiffels at mac.com
Wed Jan 23 14:56:38 PST 2013


On Wednesday, 23 January 2013 at 22:39:04 UTC, Alan wrote:
> I saw an old thread from 2004 while doing a google search that 
> discussed D and scientific computing and was looking for some 
> more recent information or opinions from people who have used 
> it for such purposes.
>
> I am a graduate student and my thesis work is in numerical 
> modeling. While I have some experience using Fortran and C, I 
> am not obligated to use any particular language for my work. I 
> like the design goals behind D and the syntax. I was would like 
> to know if D can compete with C or Fortran for numerical work.
>
> Is anyone out there using D for heavy numeric work?

Hi Alan,

I use D to build a fairly large project to analyze whole genome 
sequences from multiple individuals. I will actually upload 
things into Bitbucket soon, I will let people on this forum know. 
I use it straight as a replacement for C++, that means I use it 
for all the numeric work I used C and C++ before.

To name a few highlights:
You can very easily adapt the code samples from Numerical Recipes 
3rd edition (which are in C++) to D, with a lot more convenient 
built-in arrays and associative arrays.
Also, you can link the Gnu scientific library (GSL) straight into 
your D code. This actually had some bugs in previous versions of 
the compiler, but now it is really flawless.
I use the GSL vector class to do very fast Matrix-Matrix 
multiplications with GSL's blast interface. Also, I use GSL's 
special functions.

So I think D is ideal for scientific developers that start new 
projects. We don't have to convince huge teams to endeavour in a 
new language. We can just pick the best there is :-)

Stephan


More information about the Digitalmars-d mailing list