D for project in computational chemistry

ZombineDev via Digitalmars-d digitalmars-d at puremagic.com
Sun Aug 2 10:58:26 PDT 2015


On Sunday, 2 August 2015 at 16:25:18 UTC, Yura wrote:
> Dear D coders/developers,
>
> I am just thinking on one project in computational chemistry, 
> and it is sort of difficult for me to pick up the right 
> language this project to be written. The project is going to 
> deal with the generation of the molecular structures and will 
> resemble to some extent some bio-informatic stuff. Personally I 
> code in two languages - Python, and a little bit in C (just 
> started to learn this language).
>
> While it is easy to code in Python there are two things I do 
> not like:
>
> 1) Python is slow for nested loops (much slower comparing to C)
> 2) Python is not compiled. However, I want to work with a code 
> which can be compiled and distributed as binaries (at least at 
> the beginning).
>
> When it comes to C, it is very difficult to code (I am a 
> chemist rather than computer scientist). The pointers, memory 
> allocation, absence of the truly dynamically allocated arrays, 
> etc, etc make the coding very long. C is too low level I 
> believe.
>
> I just wander how D would be suitable for my purpose? Please, 
> correct me if I am wrong, but in D the need of pointers is 
> minimal, there is a garbage collector, the arrays can be 
> dynamically allocated, the arrays can be sliced, ~=, etc which 
> makes it similar to python at some extent. I tried to write a 
> little code in D and it was very much intuitive and similar to 
> what I did both in Python and C.
>
> Any hints/thoughts/advises?
>
> With kind regards,
> Yury

I'd say go for it. My experience with D is that you can use it 
both for fast (to write and execute) scripts and for large 
enterprise applications. You can certainly view it as a easier 
version of C, though it can offer a lot more if you need it. 90% 
of the syntax is the same as C, so there shouldn't be gotchas in 
the basic stuff.

Recently at DConf [1] John Colvin gave a talk [2] about using D 
for science which will probably be interesting for you.

Good luck :)

[1]: http://dconf.org/2015/schedule/index.html
[2]: https://www.youtube.com/watch?v=edjrSDjkfko D Is For Science


More information about the Digitalmars-d mailing list