Live data from Hacker News

Why I use the D programming language for scripting (2021)

opensource.com

1–10 of 53 posts

Re: Why I use the D programming language for scripting (2021)

#2
I've never given D a fair shake before, so my opinion of it is very weakly held, but up until now I've always thought of it as C++ with even more piles of crap bolted on. Reading the examples here makes me think that I was wrong and that I should give it a real try, because this looks like a sufficiently elegant language that I would actually want to use.

Re: Why I use the D programming language for scripting (2021)

#3
I used D for a small prototype. I wrote that same program in GO, C# and Java(native compiled with GraalVM).

The CPU and RAM usage of D-lang out performed all other languages.

Compiled binary size:

D-Lang : 450KB Go : 2 MB C#(.NET) : 8 MB Java-GraalVM: 9 MB

D-Lang CPU & RAM Usage is also less than GO. Unfortunately D-Lang is not popular, not many libraries available.

Re: Why I use the D programming language for scripting (2021)

#4
Given that D Go Rust etc. are all Turing complete, there's no difference on their ability to compute (perform) a function.

The only difference is how easy is, and how much cr*p you need to suffer in the process.

Yet I see here people patting themselves on the back just because they re-re-rewrote the algorithm of the day (git, computing the day of the week, etc) using all sorts of programming languages to claim they were there first.

So before anyone comments that they rewrote nginx in D, let me say that we don't need D or another language on top of all others we have, and that we have plenty of problems for which there's NO solution to.

Can't we focus on these please, instead of being proficient at elementary level in 40+ idioms?

Re: Why I use the D programming language for scripting (2021)

#5
post #2

I've never given D a fair shake before, so my opinion of it is very weakly held, but up until now I've always thought of it as C++ with even more piles of crap bolted on. Reading the examples here makes me think that I was wrong and that I should give it a real try, because this looks like a sufficiently elegant language that I would actually want to use.

It is definitely related to C++ (both in ideology and in participants) and AFAIU has even more features, but, for example, Scott Meyers views it[1] as having less random stupid inconsistencies than C++.

[1] https://www.youtube.com/watch?v=KAWA1DuvCnQ

Re: Why I use the D programming language for scripting (2021)

#6
post #4

Given that D Go Rust etc. are all Turing complete, there's no difference on their ability to compute (perform) a function. The only difference is how easy is, and how much cr*p you need to suffer in the process. Yet I see here people patting themselves on the back just because they re-re-rewrote the algorithm of the day (git, computing the day of the week, etc) using all sorts of programming languages to claim they w…

Turing-complete languages have been around for the better part of a century now, had we stopped after the first one we'd still be writing some kind of Zuse machine language. There's purpose in trying to make better languages, the goal is not to be able to compute more things (since we're fundamentally more limited by the hardware than by the software), but to compute old things more efficiently and more easily. D, Go, and Rust may all be as Turing-complete as each other, they have good ideas.

That, and the fact that Turing-completeness isn't really a useful concept in real life since we don't have infinite tapes with writing heads taped on top of them. In real life, a program will be more efficient if the language it's written in (or, specifically, the implementation/compiler of that language) is smarter, even though pretty much all languages we use today are technically Turing-complete

Re: Why I use the D programming language for scripting (2021)

#7
post #2

I've never given D a fair shake before, so my opinion of it is very weakly held, but up until now I've always thought of it as C++ with even more piles of crap bolted on. Reading the examples here makes me think that I was wrong and that I should give it a real try, because this looks like a sufficiently elegant language that I would actually want to use.

I've had the displeasure of having to use it professionally for a little while, and to be honest, I'd sooner rub chilli flakes into my eyeballs than have to deal with D's default garbage collector again. Seemed to be a cult-like language in the worst possible sense.

Re: Why I use the D programming language for scripting (2021)

#8
post #3

I used D for a small prototype. I wrote that same program in GO, C# and Java(native compiled with GraalVM). The CPU and RAM usage of D-lang out performed all other languages. Compiled binary size: D-Lang : 450KB Go : 2 MB C#(.NET) : 8 MB Java-GraalVM: 9 MB D-Lang CPU & RAM Usage is also less than GO. Unfortunately D-Lang is not popular, not many libraries available.

C# and Java have a large base. If you write a small application with it the size will be huge because they both link in the base in the application. It becomes more interesting with larger applications.

Re: Why I use the D programming language for scripting (2021)

#9
If I write an application I use Java as I am most comfortable with it. But it is not always the best choice. If I needed to write an application for windows with a GUI I would be more successful with C# as it would look more native. If I am writing a command line tool it would be a faster and smaller application if I build it in Go, Dart or Crystal. But then I would need to be good in it as well. I like seeing these kinds of posts. I often script in Groovy as I am fluent in Java. I like to experiment with other languages when I have time...

Re: Why I use the D programming language for scripting (2021)

#10
post #4

Given that D Go Rust etc. are all Turing complete, there's no difference on their ability to compute (perform) a function. The only difference is how easy is, and how much cr*p you need to suffer in the process. Yet I see here people patting themselves on the back just because they re-re-rewrote the algorithm of the day (git, computing the day of the week, etc) using all sorts of programming languages to claim they w…

Taking that argument to its logical extreme, why should any time spent on any of those (possibly unsolvable) problems be done in anything other than pure machine language, since that is also Turing complete?

In other words you’re severely underestimating just how much gains in easiness and reductions in suffering can contribute towards (eventually) solving the solvable subset of those problems… never mind just how significant some of those quality of life improvements can be between existing languages (and completely ignoring the potential scope of improvements not yet found in extant languages).

What if the solution to [insert sufficiently pernicious problem here] simply cannot be expressed in a human-useable fashion in a merely Turing-complete language? Having just the ability to compute a solution doesn’t mean you have the ability to understand (much less use or build atop) a solution.

Post reply on HN