Reasons to use D (over alternatives like Rust)

German Diago germandiago at gmail.com
Thu Feb 6 14:26:56 UTC 2020


On Tuesday, 4 February 2020 at 19:57:53 UTC, RaycatWhoDat wrote:
> Hi.
>
> Disclaimer: This thread isn't specifically a "this vs. that" 
> thread but more of a "help me articulate reasons" post.
>
> For the last three or so years, I've been on a bit of a journey 
> to find two or three languages that I can really dive into and 
> specialize in. I came upon D by accident about a year or so ago 
> and I really enjoyed the productivity I felt when writing it. 
> Specifically, I liked the way it felt to write and refactor and 
> optimize. I'm big on what the semantics and syntax of a 
> language feels like. This is where the problem starts.
>
> I can tell people how I feel writing the language but I can't 
> give them exact reasons as to why they'd pick D over 
> alternatives like Rust. I was hoping I could get some opinions 
> from the people here and maybe you guys can help me solidify 
> some of my own understandings.
>
> Thanks in advance.

The practical reasons (compared to other new languages):

   - Ease of use: You can write code in an almost-python way
     - Yet you can scale and tweak parts when needed
   - The ecosystem is more mature than alternatives like Nim and 
Rust
   - C/C++ interfacing is easy: use whatever libs you need in that 
area.
The social reasons:

   - It is easier to mix with C++ than most alternatives
   - It is easier to pick up for people coming from C#/Java/C/C++ 
than Rust or Nim.

I was excited about Rust until I saw that the borrow checker can 
get a lot in the way.

About Nim, it is super nice, yes, but I think they took the 
flexibility maybe too far,
but that is not the problem actually.

I think the main problem I detect is how weird and non-standard 
its OOP is. At the end, having interfaces, classes and structs is 
something quite standard: C# has them. Java has interfaces and 
classes. C++ has them (poly and non-polymorphic depending on 
virtual functions). Kotlin has them, Swift has them.

Later you look at Nim and Rust and you waste part of your time 
relearning all these things in their native language. But you 
learn this once in C#/Java/C++ and, with their slight differences 
(override style, etc.) at the end they are similar enough so that 
you get an idea of what you have to do and will focus on writing 
code and libraries, not on learning the tool.


More information about the Digitalmars-d mailing list