Live data from Hacker News

Driving with D

dlang.org

91–100 of 186 posts

Re: Driving with D

#91
post #63

Earlier quoted context omitted.

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

This is getting into a fuzzy area where one person's big difference is another person's small difference. I'd consider D templates to be a small difference from C++ templates in terms of the language[1] but big enough in terms of productivity that it would make sense to start a new project in D over C++ for that reason alone.

[1] A random commenter on HN might well conclude that there's no benefit to D's templates without using them.

Re: Driving with D

#92
post #12
post #7

Earlier quoted context omitted.

I am curious to see where Java are C# are making progress towards optional GC. This specific article talks about using No GC aka "betterC". D has GC by default; the use of GC is convenient and mainstream as most popular languages show - Java/C#/Python etc. What D gives is the unique ability to do No GC programming for the cases where GC is not desirable. Very few languages offer this capability. Zig is interesting in…

C# has added a lot of control over memory layout. Span [0], structs etc. I am hoping they add more D like features (@nogc) to the language. Java itself has just made strides on reducing GC pause times [1]. Granted, this isn't optional GC, but does D really give you that? Don't you lose the entire ecosystem and stdlib with -asBetterC? Why would I choose that over rust/zig/c++? FWIW, I am a big fan of D. [0] https://do…

> Granted, this isn't optional GC, but does D really give you that? Don't you lose the entire ecosystem and stdlib with -asBetterC?

-betterC is not the only way to avoid the GC in D, just the most extreme. The original motivation for -betterC was to ease porting C code to D. Walter has used it for that to port a good bit of his old C code over. But it's also suited for the space in which the blog author is using it, and some people just prefer it. You always have access to the existing C ecosystem, but there are people writing -betterC libraries in the D ecosystem. And as more people use it, I expect that space will grow.

Re: Driving with D

#93
post #44
post #40

Earlier quoted context omitted.

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.

I can't think of a reason that would apply here. For me at least if I were on a toolchain so crap I had to use C you'd have to pay me a lot of money not to work on something else.

All my embedded design work has been in C as i don't need all the extra cruft.

Also anything i want to be very fast on limited hardware i also use C and C only.

As for any hobby programming i do on the side, C is usually my goto choice, unless i want to be very esoteric.. following along the lines of: "The enemy of art is the absence of limitations."

Re: Driving with D

#94
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.

You're a wizard. I wouldn't have a clue where to start with a project like this.

Re: Driving with D

#95
post #24

Earlier quoted context omitted.

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

The D compiler speaks C11 now, it'll be ready for prime time in two or three releases based on speaking to Iain and Walter.

Just added C11 anonymous structs last night!

Re: Driving with D

#96
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.

No questions, but let me just congratulate you on a wonderful hack, very well done!

Re: Driving with D

#97
post #61

Earlier quoted context omitted.

Holdens are Australian, not American.

They're owned by GM now. Modern ones will be GM parts-bin cars. Going through that many GM transmissions is possible. This is why GM cars have horrible resale value and anything over 150k miles is on borrowed time.

These use GM's 4L60E 4-speed automatic. I don't remember the 4L60E being that much of a lemon that you blow through four of them with normal use.

Re: Driving with D

#98
post #24

Earlier quoted context omitted.

The D compiler speaks C11 now, it'll be ready for prime time in two or three releases based on speaking to Iain and Walter.

Just added C11 anonymous structs last night!

I saw, as long as the code stays clean I think we're going to be kicking ourselves this only happened now.

Re: Driving with D

#99
post #93
post #44

Earlier quoted context omitted.

I can't think of a reason that would apply here. For me at least if I were on a toolchain so crap I had to use C you'd have to pay me a lot of money not to work on something else.

All my embedded design work has been in C as i don't need all the extra cruft. Also anything i want to be very fast on limited hardware i also use C and C only. As for any hobby programming i do on the side, C is usually my goto choice, unless i want to be very esoteric.. following along the lines of: "The enemy of art is the absence of limitations."

I find that C actually gets in my way compared to D when I am writing code with limited resources. The end result is semantically the same but with D I can avoid macros, inline asm is easier etc.

Re: Driving with D

#100
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.

Out of curiosity, what is your job?

I'm a full time university student (20 y/o). I work part time as a labourer for a crane truck company.
Post reply on HN