A few notes on choosing between Go and D for a quick project

Joakim via Digitalmars-d digitalmars-d at puremagic.com
Thu Mar 12 20:40:19 PDT 2015


On Friday, 13 March 2015 at 00:20:40 UTC, Andrei Alexandrescu 
wrote:
> A friend of mine needed to complete a small project and thought 
> of using a language he didn't know for it. He already knew I 
> work on D so he considered it alongside Go. He ended up 
> choosing the latter, and documented his decision making process 
> in a few notes that he subsequently shared with me. I'll paste 
> below a sort of transcript of his handwritten notes.
>
> I think this is valuable information from a relatively unbiased 
> potential user, and good ideas and action items on how we can 
> improve our curb appeal. Even mistaken perceptions are good 
> signal - it means our materials weren't explicit enough to 
> dispel them.
>
> ====================
>
> * Golang: simple!
>
> + very small language, very concise & simple
> + playground/tutorial
> + easy to start using it, no-nonsense
> + vast libraries
> + no inheritance
> + one binary to distribute
> + good for servers
> + feels like a better C (mostly)
> - can't write generic code involving arrays/slices
> - no good IDE
> + Google!
> + clear feeling it's here to stay
> + visible, many projects
> + enforced style (indentation, exports)
>
> * Dlang: big!
>
> # big language
> # IDE?
> # small subset?
> # libraries?
> # will it be around?
> # Perception matters
> ## how stable is it?
> ## not great for servers or UIs; what then?
> ## new house in unpopulated neighborhood; there's an "Enter, 
> it's open" sign but sits emtpy; by comparison Go -> condo in 
> hip, trendy area

When you said "curb appeal," I was prepared to read how a cursory 
look at both websites turned him off on D and on to Go.  But none 
of these qualities can be determined so easily, you have to look 
around for a while to know that D is bigger and Go is considered 
"hip, trendy" compared to a supposedly "unpopulated" D.

Comparing the front pages of the respective language websites, 
dlang.org does a good job of actually introducing the language, 
while golang.org simply says "Go is an open source programming 
language that makes it easy to build simple, reliable, and 
efficient software."  That's it.  You have to click a couple 
times to actually get to the Go tour or manual and find out what 
Go is: there's no pitch to sell you the language first.

The recent dlang.org redesign seems to have done a good job of 
simplifying the front page, including the addition of the 
previously unavailable "Getting Started" option.  Of course, the 
front page of dlang.org is not as spare and pretty as golang.org, 
will still take a designer to spiff it up a bit.

As to his actual points, it seems to come down to D replaces C++, 
while Go replaces C.  If you're looking for a better C, the more 
advanced, C++-esque features of D might distract and confuse you, 
even though you can ignore those and use it that way.

As for "will it be around?," presumably he thinks Go will stick 
around because of Google.  That cuts both ways, because if Google 
stops funding, maybe Pike and the other main devs abandon it, 
while D seemingly has never had anyone sponsoring Walter, so 
there's nobody holding the funding spigot here.

Not sure why he thinks D isn't good for servers, as that's what 
its key corporate backers all use it for.  I don't deny that some 
of these perceptions exist, not sure how being considered "hip, 
trendy" is combated other than by having more success.

> * Ideas for D
>
> # what C++ should be but cannot
> ## too late for C++, but not for D
> ## some or all of @safe, immutable, pure should be the default
> # libraries, projects should be prominently listed and nurtured

Good suggestion for the front page, perhaps a library of the 
month?

> # single-idea advantage; D seems to embody too many ideas at 
> once
> ## concurrency?
> ## networking?

Where is D advertised as being special or different with its 
ideas on networking?  I don't see it.

> ## generics?
> ## interoperability with C and C++?
> ## focus on one!

That's not D's approach, for better or worse.  It's offering a 
buffet of features, not just a great steak.

> # must attract/hook casual users

I agree that D's use in small programs and scripting could be 
better emphasized.  In trying to attract the C++ crowd, this 
orthogonal audience is sometimes ignored.

> # unclear what's a good IDE - JetBrains? is there Vim support?

The D Wiki lists supported IDEs, maybe the "Getting Started" page 
should directly link there.

> # what's D's equivalent to frameworks such as react.js?
> # language designers think of features, users think of purpose
> ## react, go, rust, java -> purpose

React is a UI framework, easy to state its purpose.  Go has 
essentially nothing on their front page, while Rust just has a 
feature list.  Java is the only one that talks about rationale 
and purpose:

https://www.java.com/en/about/

> ## D, C++ -> "Ivy league candidates" having a response for 
> every programming language design challenge there is, but less 
> focused on purpose (Andrei's note: I assume D more at fault 
> than C++ on this)

I agree that dlang.org could go a bit more into purpose, other 
than the single mention of "simple scripts to large projects" on 
the front page.  I can see how it's tough to articulate how 
widely D could be used though.

> General feeling: "I don't feel smart enough for D and am 
> looking for a quick way to accomplish a goal. I've read the 
> Wikipedia article on D and didn't understand a few things. The 
> examples seem to show off the language but that made them 
> confusing. I wanted to get more into it, but by that time Go 
> had already won - I looked at the tutorials, changed the sample 
> code a bit right in the browser to see how it'd work for me, it 
> was easy, I was in already. Some of my comments therefore 
> illustrate my shortcomings than the language's, but that's true 
> one way or another for all programmers (that's why technical 
> superiority of a language doesn't guarantee its success)."

On the one hand, yes, D beats you over the head with all its 
great advanced features.  On the other hand, a language like D, 
that wants to give you all the tools for your toolbelt, requires 
a programmer that is capable of knowing what each tool is and how 
to use it.  It's very tough to advertise it as a BMW, ie a 
driver's car, and then say, "oh yeah, you soccer dads will love 
it too."  Blackberry is dying for a reason.


More information about the Digitalmars-d mailing list