Why I'm Excited about D

Meta via Digitalmars-d digitalmars-d at puremagic.com
Mon Apr 6 20:02:39 PDT 2015


On Monday, 6 April 2015 at 23:51:17 UTC, Adam Hawkins wrote:
> Hello everyone, this is my first post on the forum. I've been 
> investigating the language for the past few weeks. I was able 
> to complete my first useful program thanks to very helpful 
> people in #d on IRC . The experience made me very interested in 
> the language and improving the community around it.
>
> I'm primarily Ruby developer (been so about the last 7-8 years) 
> doing web stuff with significant JavaScript work as well. I 
> wrote a blog post on why I'm excited about D. You can read it 
> here: http://hawkins.io/2015/04/excited-about-d/.
>
> I've been reading the forums here so I can see that there is a 
> focus on improving the marketing for the language and growing 
> the community. I see most of the effort is geared towards C++ 
> programmers, but have you considered looking at us dynamic 
> languages folk? I see a big upside for us. Moving from Ruby to 
> D (my case) gives me power & performance. I still have OOP 
> techniques but I still have functional things like closures and 
> all that good stuff. Only trade off in the Ruby case is 
> metaprogramming. All in all I think there is a significant 
> value promise for those of us doing backend services for folks 
> like me.
>
> Regardless, I figured it might be interesting to hear about 
> some experience coming to the language from a different 
> perspective. Cheers!

Very nice article. I have two suggestions:

import std.stdio, std.parallelism;

auto names = [ "Adam Hawkins", "Peter Esselius" ];

foreach(name; taskPool.parallel(names)) {
     writeln(name);
}

There is a convenience function in std.parallelism that allows 
you to write the following instead for your foreach loop:

foreach (name; names.parallel) {
     writeln(name);
}

Also, @system, @trusted, @safe don't really have much to do with 
optimization or access levels, but safety. Theoretically, if all 
of your code is @safe, then it is impossible for your program to 
corrupt memory.

Also, have you considered posting this article to Hacker 
News/Reddit?


More information about the Digitalmars-d mailing list