Pitching D to a gang of Gophers

Shammah Chancellor via Digitalmars-d digitalmars-d at puremagic.com
Sat Mar 5 23:21:15 PST 2016


On Saturday, 5 March 2016 at 11:05:09 UTC, Dmitry Olshansky wrote:
> I'm having an opportunity to do a small tech-talk on things D 
> in a eCommerce shop that is currently sold on Go (migrating to 
> SOA from PHP monolith). I do not intend that to become Go vs D 
> battle but it gives the context.
>
> What guys seem to like of Go from my observation:
> - goroutines instead of direct asynchronous programming*
> - fast runtime with state of the art GC
> - host of ready-made libraries esp. http & networking**
> - lightweight OOP that doesn't get in your way
> - tooling, tooling, tooling (IDE plugins and build tools work 
> great)
>
> *Note: all of standard I/O is transparently handled with 
> goroutines much like vibe.d but goroutines are migrating across 
> thread pool
> ** That being said there are tons of 1-man projects of dubious 
> quality,
>
> So far I'd thought of a few big themes:
> - little nice things (slices/maps, things like 1_000_000 and 
> e.g. a < b && d < e is parse error, UFCS)
> - code reuse (templates & ranges, with examples like generic 
> min and some algo)
> - compile-time works (CTFE, need simpler example then regex)
>
> I'm still pondering whether I should dive into UDA, I'd try to 
> stay simple as simplicity is one of things Go guys known to 
> love.
>
> What features you'd highlight to enterprise-ish user?

I work in a 99% Go shop (a splash of C, and some smattering of 
scripts for in-house tools.)  I've tried to use D for a few 
things, and tried to get other people interested in it.  So, 
here's my perception:

Everything you've said is true, and D should focus on making some 
of these things much better.  Additionally, the compiled (mostly 
single binary nature) of Go makes it very nice for deployments.   
Focusing on dfmt, and dfix would be a huge win.

Here's some stuff D shares with Go:

"Single" binary deployments.
Garbage Collector
In-language slices and maps
Foreach (Although D is much more powerful here)

Some things D is weak on:
* The name -- all I ever hear are penis jokes.
* Garbage Collector (!)
* dfix and dfmt aren't as good as gofmt and gofix. (And believe 
me I understand they will be much more difficult to get to parity 
due to the feature set of D)
* Docs  -- although these have gotten much much better recently 
-- the current implementation of concepts makes it hard for 
people to know where and when they can use a type.  E.g sort docs 
(http://dlang.org/phobos/std_algorithm_sorting.html#sort) How do 
I know what types of things I can sort as a newcomer? Even if I 
figure out that I need to look at isForwardRange, the docs there 
aren't terribly helpful either 
(https://dlang.org/phobos/std_range_primitives.html#isForwardRange)  I would put up a PR, but I don't know how to fix it without introducing a language structure for Concepts -- but this has been veto'd for a variety of reasons (primarily type explosion as I understand the arguments)
* Libraries

Some things D is much better on (and would cause me to choose it 
every time and just contribute fixes where I could to the 
external tools):

* Package management/build tools
* Integration with existing build systems/libraries
* Reusable algorithms that are FAST
* Empowering programmer expressiveness without enabling magic

-S.


More information about the Digitalmars-d mailing list