Live data from Hacker News

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

opensource.com

41–50 of 53 posts

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

#41
I gave D a honest shot a couple of years ago and used the web framework Vibe.d.

Coming from the scripting world (Ruby) D wasn’t that hard to get started with nor was the learning curve that steep.

I usually prefer to stick with the few languages I already know, but D lang was very fun to play around and build something with, it was kinda worth it because the language was interesting to explore.

The possibilities to meta-program was endless, it’s very powerful.

Something I would like to highlight is that D lang was performant out-the-box, don’t let the GC scare you. D also felt fast to read & write once you got the hang of it.

It also has some interesting concepts like “Turtles all the way down”.

I would highly suggest giving it a try, it’s really an interesting language worth exploring and I think it has matured a lot since.

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

#42
To me D is the best C like language, you can use it for system needs with manual memory management, OR if you prefer the safety of a GC, you can do that as well!

If you enter the manual memory management route, there won't be many libraries at your disposal, but you can leverage the entire C/C++ ecosystem, so that's no big deal, you go manual memory management route because you want performance and control after all

I use D for my main projects, and i love it, i still try some new languages (i picked odin recently), but i always fall back to D, because of how convenient it is to switch from system to scripting language

The only areas where i want to see D progress are:

- modern language features, such as tagged union, this one definitely helps a lot when you don't want to use the GC/OOP, i liked odin because of that part

- tooling: while the LSP is great, it doesn't support all of the D language features, so i'd love to see a builtin one, like rust's and zig's team doing, that would also help ease the learning curve for new users

- an official allocator API, so people could design libraries for GC users and manual memory mangement users transparently, avoiding the fragmention of the community

D has a bright future, it is independent, has many small companies using it, and grow at a organic rate

I don't think the new languages offer enough to make D irrelevant, they are all stuck with LLVM, while D has its own mature backend! and for that reason, D stands out!

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

#43
post #23

Hope it's not seen as criticism... but I could love more elaborate examples... Checking the examples, my friction here is... why should I introduce a new language for those things? First example program equivalence: tr -s ' ' '\n' Second program equivalence: awk 'NR It takes to me more time, to understand what is doing D, even if theres is a previous explanation, that write down the equivalence with known tools. The…

  awk 'NR

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

#45

I think D is a victim of being too early - when it was announced the open source community was still obsessed with C, and D’s garbage collection was seen as an absolute show-stopper (even if the people knocking it largely didn’t try it). By the time Go came out a decade later I guess enough people had been bitten by C that garbage collection was an acceptable option (plus Google’s backing and a more complete standard…

Maybe there is a little of that, but I think it was largely the D compiler's weird source-available licensing.

Lots of people were using C++ and were not happy with it.

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

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

Having used I'd sooner file it under "C, with just enough added, removed, and fixed to make it a pleasant modern language", but then my native language is python so take that with a grain of salt if you're a C/C++ person.

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

#48
post #29

We're working on "scripting" support for Rust ( https://doc.rust-lang.org/nightly/cargo/reference/unstable.h... ). Currently our biggest open design issue is what syntax to use for embedding the manifest (Cargo.toml).

I like it so much that you can just specify dependenies in the script.

That's what I hate about python scripts - as soon as you need one third party dependency, the ease of running the script just jumps out of the window and you need to create an entire project in its own dedicated directory and include install instructions for people who want to run it.

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

#49

Earlier quoted context omitted.

Not necessarily anymore now that .NET has had a lot of enhancements for compiling to native and stripping unused references.

I think a lot of people who write off C# don't realise how much it has advanced particularly in the last few years.

C# is getting that sweet spot of how a modern version of Modula-3 should look like.

I also expect the same for Java, if Valhala ever makes it.

So even though Remedy Games had some experience with D, it is C# that gets all the attention as C++ alternative in tooling and graphics engine scripting, while everything that isn't performance critical in Android (no GC at all), gets written in Java/Kotlin.

These are two good examples of how D lost a potencial market, by always re-inventing itself for the next wave of developers that will finally get D and leave everything behind to adopt it, instead of focusing on having something to make it special for adoption.

Post reply on HN