Live data from Hacker News

D Programming Language

dlang.org

241–250 of 278 posts

Re: D Programming Language

#241
post #230

Earlier quoted context omitted.

So what, that is exactly the point. A programming language having a GC doesn't mean every single allocation needs to be on the heap. C# is finally at the sweet spot languages like Oberon, Modula-3 and Eiffel were on the late 90's, and unfortunely were overshadowed by Java's adoption. Go and Swift (RC is a GC algorithm) are there as well. D could be there as well on the mainstream, if there was a bit more steering int…

The point is that if you need performance you need to drop below tracing GC, and depending on your use-case, if that's the majority of your code it makes sense to use a language that's built for that kind of programming (zero cost abstractions). Writing C# that doesn't allocate is like wearing a straightjacket and the language doesn't help you much with manual memory management. Linters kind of make it more manageabl…

> Writing C# that doesn't allocate is like wearing a straightjacket

Yes, and that's where D is majorly superior to C# -- it's flexible enough for you to go down to the metal for the critical parts.

Re: D Programming Language

#242
post #118

Earlier quoted context omitted.

This very post is probably his too, under an alt :)

I was hoping to see one of his posts here. If he's going to post under an alt, he should advertise it so that I can know which posts I should be taking extra ironically.

He's not posting under an alt--that's an absurd slander.

Re: D Programming Language

#243
post #219
post #158

Earlier quoted context omitted.

FillC works fine with all C code no matter how low level. There’s a small performance overhead but for almost every scenario it’s an acceptable overhead!

up to 5x is not what most people mean by small.

Depends on what the multiplicand is.

Re: D Programming Language

#244
post #229
post #51

I often see people lament the lack of popularity for D in comparison to Rust. I've always been curios about D as I like a lot of what Rust does, but never found the time to deep dive and would appreciate someone whetting my appetite. Are there technical reasons that Rust took off and D didn't? What are some advantages of D over Rust (and vice versa)?

> Are there technical reasons that Rust took off and D didn't? This talk explain why, it's not technical: https://www.youtube.com/watch?v=XZ3w_jec1v8 > What are some advantages of D over Rust (and vice versa)? Advantages for D: Build faster, in typical programs you would need about 20 packages not 100, COM objects, easy meta-programming, 3 compilers. GC, way better at scripting. Advantages for Rust: borrow-checker is…

> This talk explain why, it's not technical: https://www.youtube.com/watch?v=XZ3w_jec1v8

Really good talk, I remember watching it when it came out. Elm is what got me looking into FP several years ago, a nice language it was.

Re: D Programming Language

#245

Earlier quoted context omitted.

The point is that if you need performance you need to drop below tracing GC, and depending on your use-case, if that's the majority of your code it makes sense to use a language that's built for that kind of programming (zero cost abstractions). Writing C# that doesn't allocate is like wearing a straightjacket and the language doesn't help you much with manual memory management. Linters kind of make it more manageabl…

> Writing C# that doesn't allocate is like wearing a straightjacket Yes, and that's where D is majorly superior to C# -- it's flexible enough for you to go down to the metal for the critical parts.

That is the no longer the case in C# 14/.NET 10, D has lost 16 years counting from Andrei's book publishing date, letting other programing languages catch up to more relevant features.

You are forgetting that a language with a less mature ecosystem isn't much help.

Re: D Programming Language

#246

Earlier quoted context omitted.

> C# C interop is pretty smooth True, but you still need to either generate or manually write the bindings. In D, you just import the C headers directly without depending on the bindings' maintainers. > If it was an actual C++ modernization attempt that stayed C compatible it would have seen much better Any D compiler is literally also a C compiler. I sincerely don't know how can one be more C compatible than that. >…

I'm not saying D didn't have nice features - but if D/C#/Java are valid options I'm never picking D - language benefits cannot outweigh the ecosystem/support behind those two. Go picked a niche with backend plumbing and got Google backing to push it through. Meanwhile look at how popular Zig is getting 2 decades later. Why is that not D ? D also has comp-time and had it for over a decade I think ? Zig proves there's…

> Why is that not D ?

You never get a second chance at making a good first impression.

I believe that many people that gladly use Rust or Zig or Go nowadays would be quite happy with D if they were willing to give it a fair evaluation. But I still often find people going "D? I would never use a language where the ecosystem is split between different standard libraries"/"D? No thanks, I prefer compilers that are open source" or similar outdated claims. These things have not been true for a long time, but once they are stuck in the heads of the people, it is over. And these claims spread to other people and get stuck there.

If you do not want to use a GC, it is trivial to avoid it and still be able to use a large chunk of the ecosystem. But often avoiding GC at all costs is not even necessary - you mostly want to avoid it in specific spots. Even many games today are written with tasteful usage of GC.

The one thing that really is a fair disadvantage for D is its small community. And the community is small because the community is too small (chicken/egg) and many believe in claims that have not been true for a long time ...

Re: D Programming Language

#247
post #227

Earlier quoted context omitted.

1. Java nowadays has Panama 2. Java and C# can also generate native binaries, just like Go, no need for VM. 3. C++ nowadays has concepts, modules and compile time execution This wasn't true in 2010, but D has let them catch up with missing features.

what are you referring to regarding Java? I'm aware C# has AOT (and il2cpp for Unity projects) but I don't recall hearing about any sort of Java native binary that isn't just shipping a VM and java bytecode (ignoring the short-lived GNU java compiler).

Java has had AOT compilers since around 2000, they only happened to be commercial, Excelsior JET was the most famous one.

There were several vendors selling AOT compilers for embedded systems, nowadays they are concentrated into two vendors, PTC and Aicas.

Then you have the free beer compilers GraalVM and OpenJ9, which are basically the reason why companies like Excelsior JET ended up closing shop.

Also .NET has had many flavours, starting with NGEN, Mono AOT, Bartok, MDIL, .NET Native, and nowadays Native AOT.

Both ecosystems are similar to Lisp/Scheme nowadays, having a mix of JIT and AOT toolchains, each with its plus and minus, allowing the developers to pick and choose the best approach for their deployment scenario.

Re: D Programming Language

#248
post #245

Earlier quoted context omitted.

> Writing C# that doesn't allocate is like wearing a straightjacket Yes, and that's where D is majorly superior to C# -- it's flexible enough for you to go down to the metal for the critical parts.

That is the no longer the case in C# 14/.NET 10, D has lost 16 years counting from Andrei's book publishing date, letting other programing languages catch up to more relevant features. You are forgetting that a language with a less mature ecosystem isn't much help.

> C# 14/.NET 10

Yes, they added AOT but it's still challenging to do anything that requires calling into the OS, because you're going to need the bindings. It will still add some overhead under the hood and more overhead will you need to add yourself to convert the data to blittable types and back.

Mixing C# with other languages in the same project is also difficult because it only supports MSBuild.

> You are forgetting that a language with a less mature ecosystem isn't much help.

Fair.

Re: D Programming Language

#249
post #245

Earlier quoted context omitted.

That is the no longer the case in C# 14/.NET 10, D has lost 16 years counting from Andrei's book publishing date, letting other programing languages catch up to more relevant features. You are forgetting that a language with a less mature ecosystem isn't much help.

> C# 14/.NET 10 Yes, they added AOT but it's still challenging to do anything that requires calling into the OS, because you're going to need the bindings. It will still add some overhead under the hood and more overhead will you need to add yourself to convert the data to blittable types and back. Mixing C# with other languages in the same project is also difficult because it only supports MSBuild. > You are forgett…

You also need bindings in D, nothing new there.

Rust also has issues using anything besides cargo.

Re: D Programming Language

#250
post #246

Earlier quoted context omitted.

I'm not saying D didn't have nice features - but if D/C#/Java are valid options I'm never picking D - language benefits cannot outweigh the ecosystem/support behind those two. Go picked a niche with backend plumbing and got Google backing to push it through. Meanwhile look at how popular Zig is getting 2 decades later. Why is that not D ? D also has comp-time and had it for over a decade I think ? Zig proves there's…

> Why is that not D ? You never get a second chance at making a good first impression. I believe that many people that gladly use Rust or Zig or Go nowadays would be quite happy with D if they were willing to give it a fair evaluation. But I still often find people going "D? I would never use a language where the ecosystem is split between different standard libraries"/"D? No thanks, I prefer compilers that are open…

> You never get a second chance at making a good first impression.

There's a good number of younger programmers like myself who've never heard of D, say, before 2017 when those false claims were still true. Our first impression of D comes from its state today, which is not that far behind from other emerging languages.

Post reply on HN