Skip to content
← Back to Community
Language reviews: D
Profile icon
CodeLongAndPros

Language review: D

Big, fat D

D is a general-purpose programming language with static typing, systems-level access, and C-like syntax. With the D Programming Language, write fast, read fast, and run fast.

It's pretty much C+++ (C++)+

It's strongly, statically typed, has safe pointer usage, built in unit tests, and more.

It was made by Walter Bright in 1999, with the first public version in 2001, and 1.0 in 2007.

Some code examples:

(Compute average line length for stdin)

void main() { import std.range, std.stdio; auto sum = 0.0; auto count = stdin.byLine .tee!(l => sum += l.length).walkLength; writeln("Average line length: ", count ? sum / count : 0); }

(Invoke external program)

void main() { import std.exception, std.stdio, std.process; auto result = ["whoami"].execute; enforce(result.status == 0); result.output.write; }

As you can see, D is a very simple, very fast (On par with C++) language, with only a few cons.

  • Phobos (Stdlibs) documentation is hard to understand, unlike Python's or JS'
  • Not a lot of support / documentation for stuff like GUI's
  • No native Replit support yet. (Use this template)

However, not is all bad

Some of the gems in D:

  • Built in unit test support:
int sum(int a, int b) return a + b; void main() { unittest { assert add(1, 1) == 2; assert add(1, 1) != 3; } }

Total scores:

Usability: 70% (Lacking in GUI bindings)
Ease of development: 80% (Some strange operators)
Documentation: 50% (Good docs, hard to read)

Total score: 66%

Should you use D?

Yes, unless you are doing GUI work (GTK, QT)

Voters
Profile icon
Kookiez
Profile icon
DungeonMaster00
Profile icon
Highwayman
Profile icon
HahaYes
Profile icon
CodeLongAndPros
Comments
hotnewtop
Profile icon
DungeonMaster00

As a person who likes D a ton, it should have a better editor.

For example, when I type in left parenthesis, there is no right parenthesis generated. The same happens for brackets too.

Another thing. I can't blame repl.it for this, but whenever I make a bracket for an if statement or loop, it doesn't indent again automatically. It just keeps track of the indentation level for you.

Honestly, we should consider ourselves lucky that repl.it provides SYNTAX HIGHLIGHTING for D files That's how garbage I think the D editor is in repl.it. Even the C# editor in repl.it is better.

One last note; there are custom D GUI libraries that you can install with the DUB. I just haven't figured out how to get those yet.

Overall, D is still good. But I still believe it can be better, both in the overall language and the repl.it editor.

Profile icon
CodeLongAndPros

@nk1rwc I’ve added d support to polygott, but until I get hired under replit or can add code, no dice.

Profile icon
TheDrone7

That title looked like a type for the emoji :D.

Profile icon
CodeLongAndPros

@TheDrone7 Oh, I never noticed that.

Profile icon
Highwayman

In fact the whole Phobos library documentation has been generated with DDoc.

So that’s why it’s wonky...

Profile icon
CodeLongAndPros

@Highwayman The docs are fine, but they lack explanations and examples

Profile icon
Highwayman

Exactly. It would be somewhat cumbersome to supply those in the code, so they don’t have them.... that’s what I mean :P @CodeLongAndPros

Profile icon
Highwayman

Wouldn’t it be C++++? (C++)++

Profile icon
CodeLongAndPros

@Highwayman I think that’s C#

++ ++

It’s a little lower level than C#.

Profile icon
Highwayman

Hmmm alright. @CodeLongAndPros

Profile icon
CodeLongAndPros

@Highwayman C++++ is more like Java than C++

Profile icon
Highwayman

I wonder what python is....

c++++++++++++...+++++
@CodeLongAndPros

Profile icon
DungeonMaster00

@Highwayman i realised something, dlang is ++c

Profile icon
Highwayman

In a site full of nerds you have managed to beat us all I applaud and congratulate you XD
@nk1rwc

Profile icon
ComradeRiley

@CodeLongAndPros C# is more like java than C++++

Profile icon
CodeLongAndPros

@ComradeRiley Yes but four pluses:

++ ++
Profile icon
HahaYes

CODELONG IS BACK

Profile icon
CodeLongAndPros

@HahaYes I have returned from hiatus —read minecraft—, only to enter into another —but I shall return!

Profile icon
HahaYes