Live data from Hacker News

Driving with D

dlang.org

61–70 of 186 posts

Re: Driving with D

#61
post #58

> From the factory, it came with a rubbish four-speed automatic gearbox. During 18 months of ownership, I destroyed four gearboxes. [I'm from Europe.] I absolutely don't get this. Just... what? Four gearboxes? I don't know anyone who destroyed a single one - even after an entire lifetime of daily driving, but I don't mean Mercedeses - more like Škodas. What's up with American cars? Is this common? Edit: my bad, the c…

Holdens are Australian, not American.

Re: Driving with D

#63

Earlier quoted context omitted.

Not different enough to be worth switching from Java/C++ with their much bigger and more established communities. This was especially true earlier in it's history when it required GC. Now it doesn't, but it has to compete with Rust which can also offer memory safety.

> Not different enough to be worth switching from Java/C++ with their much bigger and more established communities. Companies using Java or C++ don't switch because a language is "sufficiently different". I've been involved in programming language discussions for decades and I've never heard of a company switching to a language because it was different from what they were already using, though being too different is…

"Different" is not a reason to switch, but "not different enough" is a reason not to switch.

When switching is costly, the potential upside must be big. When the other language seems similar, the upside also seems limited. When there are few differences, you can rationalize staying with the old language, because it may catch up with the features, or you can emulate the missing features, or just live without them, if the differences are small.

Re: Driving with D

#64
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…

I don't know that it's essential that a big company be behind a language. What's essential is that the tooling and the libraries be top-notch. That's beyond the reach of an individual, or even a small team. But a large company can easily provide the resources to do that.

(The third essential is that a language do something significantly better or easier than existing languages. A language can't just be "does the same as C, but with a bit different syntax", unless it's radically better syntax. Switching languages has a cost; your new language has to pay back that investment or it won't get used.)

Re: Driving with D

#65
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: -…

> such as the fact that a safe subset exists, but depends on GC, @safe works perfectly fine and exactly the same in @nogc code as in GC-enabled code.

My mistake - SafeD was introduced since I stopped using D, so I was going off this article:

https://dlang.org/articles/safed.html#safed-subset

> When you enter SafeD, you leave your pointers, unchecked casts and unions at the door. Memory management is provided to you courtesy of Garbage Collection.

Does D provide the necessary tooling to be able to expose a safe API for something which needs to allocate memory, without needing a GC?

Re: Driving with D

#66
post #58

> From the factory, it came with a rubbish four-speed automatic gearbox. During 18 months of ownership, I destroyed four gearboxes. [I'm from Europe.] I absolutely don't get this. Just... what? Four gearboxes? I don't know anyone who destroyed a single one - even after an entire lifetime of daily driving, but I don't mean Mercedeses - more like Škodas. What's up with American cars? Is this common? Edit: my bad, the c…

> great for racing

that could explain a bit

Re: Driving with D

#67
post #55
post #42

Earlier quoted context omitted.

I don't think minimal compiler complexity is a real requirement as much as safe and reliable software is. CPU fabs aren't easy, yet we're fine with that.

It matters for portability. I'm not saying it's the most important requirement, of course, but it's C strongest point.

Do you need to build an entire compiler or "just" the backend/code generation to port something? Although "just" a code generation for Rust means building one for LLVM, which I'm sure is harder than some C compilers out there.

Re: Driving with D

#69
post #32
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: -…

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

To give some perspective: mrustc is written mostly by one person, in C++ and it caught up to 1.39.0 recently - meaning it can "compile" rustc itself (without any type safety validation) as opposed to arbitrary Rust code.

Also C++ compilers are hard too. And optimizing C compilers are hard too...

Re: Driving with D

#70
post #53

Earlier quoted context omitted.

He said he's gone to bed, but he's a student.

I must have missed that comment, just saw "I have work in about 4 hours"

It was on our discord, I should've said. Feel free (to anyone) to join if you'd like to learn more about D.
Post reply on HN