Live data from Hacker News

Driving with D

dlang.org

31–40 of 186 posts

Re: Driving with D

#31
post #27
post #2

Any reasons D never caught on more? No big tech company anchor behind it?

As far as I know D's original design strategy, was to be a simpler to use C++ with a GC, but with the same expressive power Over time, this proved to be a bad strategy, C++ key strength became RAII (deterministic memory management), so the GC became a failed strategy The maintainers tried to move in different directions, adding manually memory management, making the GC optional, moved D to be a C replacement, with th…

This isn't a very good summary of how the language evolved.

D has basically always had the ability to not use the GC, it's only recently that we've taken an interest in replacing C. The GC has been written in D for a very long time, that wouldn't be the case if the language didn't allow manual memory from day 1.

BetterC is a nice-to-have rather than a language dialect.

Having a GC is an absolute godsend for getting clean code out of the door quickly.

Re: Driving with D

#32
post #17
post #2

Any reasons D never caught on more? No big tech company anchor behind it?

I used D for a while. It improves several things over C++, among them: - More powerful metaprogramming capabilities. - Better module and library system. - Nicer syntax. The problem IMO is it's just not enough to justify a total move from C++ -> D. The syntax of C++ can't really be fixed, but the other aspects can be improved without a new language. Furthermore, many of the other downsides of C++ are still present: -…

Except that Rust compilers seem incredibly hard to implement, as opposed to C.

Re: Driving with D

#33
post #2

Any reasons D never caught on more? No big tech company anchor behind it?

Ultimately, for any language to become popular, it must bring something radically new on the table (e.g. Java: relative performance, simplicity and safety; Python: immediacy; etc.), and/or have a big company behind. D doesn't have any of the two (unfortunately! I do appreciate the language).

This viewpoint is typically represented by the question "what can I do in X that I can't in C++?".

Something I personally find interesting is the thought experiment: if Golang was written by a small actor, and D by a big one, which one would have succeeded?

Re: Driving with D

#34
post #18
post #15

UFCS example uses units, which looks neat, but assigns injectorWidth to a variable injectorTime, which seems wrong?

I use D every day at work (inherited codebase) and the UFCS bothers me to no end. I try not to use it.

Can you explain why? I have never used D, but I think UFCS is really convenient.

Re: Driving with D

#35
post #2

Any reasons D never caught on more? No big tech company anchor behind it?

Honestly, I believe it is much more about marketing than one might expect.

Agree. I think this is one of the reasons Ada has seen (and continues to see) so little use.

Re: Driving with D

#36
post #13

Hi, I'm the author of the article. Feel free to ask any questions you may have. I have to go to bed, I have work in about 4 hours, so I'll reply when I can.

What are the legal hurdles you had to jump to get this hack approved for street use? As car modders know all too well, this can often be the hardest task.

Re: Driving with D

#37
post #2

Any reasons D never caught on more? No big tech company anchor behind it?

Certainly not the sole reason, but the mix of language features puts it into a weird spot: You have great control over memory layout and can easily embed assembler, which would be perfect for performance sensitive software like games. Yet "default" D comes with a garbage collector and - more importantly - language features that require said GC.

If you want to go the noGC route, you have to refrain from using certain language constructs, which puts you in a similar spot as with C++...

And if you actually want a GC, you might find the simple linear allocator of D to be lacking...

D is a very cool language, but it is also a lot like QTified C++... Which, well, already exists...

Re: Driving with D

#38
post #2

Any reasons D never caught on more? No big tech company anchor behind it?

Certainly not the sole reason, but the mix of language features puts it into a weird spot: You have great control over memory layout and can easily embed assembler, which would be perfect for performance sensitive software like games. Yet "default" D comes with a garbage collector and - more importantly - language features that require said GC. If you want to go the noGC route, you have to refrain from using certain…

I'm surprised you mentioned memory allocation without spotting the memory allocators in the standard library. Andrei designed the library and as far as I can tell no other language comes close when it comes to composable allocators.

Re: Driving with D

#40
post #19
post #17

Earlier quoted context omitted.

I used D for a while. It improves several things over C++, among them: - More powerful metaprogramming capabilities. - Better module and library system. - Nicer syntax. The problem IMO is it's just not enough to justify a total move from C++ -> D. The syntax of C++ can't really be fixed, but the other aspects can be improved without a new language. Furthermore, many of the other downsides of C++ are still present: -…

The idea that Rust is suitable to replace C and D isn't is odd to me. It's really not hard to do + we (unlike some languages, not sure about rust) actually test on embedded targets via GCC.

What I meant by this is: if you are starting a project today, and have to choose between C and C++, there are certain reasons why you might choose C over C++.

Those same reasons would apply for choosing C over D. They might not apply for choosing C over Rust.

Post reply on HN