Live data from Hacker News

D Programming Language

dlang.org

51–60 of 278 posts

Re: D Programming Language

#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)?

Re: D Programming Language

#53

Earlier quoted context omitted.

OOP and ownership are two concepts that mix poorly - ownership in the presence of OOP-like constructs is never simple. The reason for that is OOP tends to favor constructs where each objects holds references to other objects, creating whole graphs, its not uncommon that from a single object, hundreds of others can be traversed. Even something so simple as calling a member function from a member function becomes incre…

On the flipside, with OOP is usually quite easy to put a debugger breakpoint on a particular line and see the full picture of what the program is doing. In diehard FP (e.g. Haskell) it's hard to even place a breakpoint, let alone see the complete state. In many cases, where implementing a piece of logic without carrying a lot of state is impossible, functional programming can also become very confusing. This is espec…

That is true, but on the flip-flip side, while procedural or FP programs are usually easy to run piecewise, with OOP, you have to run the entire app, and navigate to the statement in question to be even able to debug it.

Imho, most FP languages have very serious human-interface issues.

It's no accident that C likes statements (and not too complex ones at that). You can read and parse a statement atomically, which makes the code much easier to read.

In contrast, FP tends to be very, very dense, or even worse, have a density that's super inconsistent.

Re: D Programming Language

#54

Sigh. Ownership and borrowing are so much less baroque in D than in Rust. And compile times are superb. In a better world, we would all be using D instead of C, C++ or Rust. However in this age of Kali...

OOP and ownership are two concepts that mix poorly - ownership in the presence of OOP-like constructs is never simple. The reason for that is OOP tends to favor constructs where each objects holds references to other objects, creating whole graphs, its not uncommon that from a single object, hundreds of others can be traversed. Even something so simple as calling a member function from a member function becomes incre…

>one of the biggest flaws of OOP is that if x.foo() calls x.bar() in the middle, x.bar() can clobber a lot of local state, and result in code that's very difficult to reason about

That's more a problem of having mutable references, you'd have the same problem in a procedural language.

Re: D Programming Language

#55

Earlier quoted context omitted.

> We all know... HN isn't as homogeneous as you think. By this measuring stick, half of the posts on the front page can be put into question every day.

Let's be serious, most people are regulars and this has been on the front page multiple times like constantly. And it was upvoted 4 times on new to get to the front page rapidly. It's not something new that we're all "Oh that's cool". We also know there are tons of sock accounts. And no half of the posts on front page can't be put in that since they aren't constantly reposted like this. So, while there are a few peop…

Do you know the joke with "I'll repeat the joke to you until you understand it?".

That's why some things get reposted and upvoted. In hope of getting someone else to understand them.

By the way, do you complain about sock accounts when yet another "Here is this problem, and by the way we sell a product that claims to solve it" gets upvoted?

Re: D Programming Language

#56
post #20

D is like a forced meme at that point. Never has an old language gained traction, its all about the initial network effects created by excitement. No matter how much better it is from C now, C is slowly losing traction and its potential replacements already have up and running communities (Rust, zig etc)

Python was first released in 1991. It rumbled along for about 20 years until exploding in popularity with ML and the rise of data science.

Oh? How about Raymond's "Why python?" article that basically described the language as the best thing since sliced bread? Published in 2000, and my first contact with python.

Re: D Programming Language

#57
post #20

Earlier quoted context omitted.

Python was first released in 1991. It rumbled along for about 20 years until exploding in popularity with ML and the rise of data science.

Python was common place long before ML. Ever since 1991, it would jump in popularity every now and then, collect enough mindshare, then dives again once people find better tools for the job. It long took the place of perl as the quick "linux script that's too complex for bash" especially when python2 was shipping with almost all distros. For example, python got a similar boost in popularity in the late 2000s and earl…

> I always dread dealing with python developers though tbh.

Out of curiosity, why is that?

Re: D Programming Language

#58
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)?

More like the companies that jumped into D versus Rust, D only had Facebook and Remedy Games toy a bit with it.

Many of us believe on automatic memory management for systems programming, having used quite a few in such scenarios, so that is already one thing that D does better than Rust.

There is the GC phobia, mostly by folks that don't get not all GCs were born alike, and just like you need to pick and chose your malloc()/free() implementation depending on the scenario, there are many ways to implement a GC, and having a GC doesn't preclude having value types, stack and global memory segment allocation.

D has compile time reflection, and compile time metaprogramming is much easier to use than Rust macros, and it does compile time execution as well.

And the compile times! It is like using Turbo Pascal, Delphi,... even thought the language is like C++ in capabilities. Yet another proof complexity doesn't imply slow compile natives in a native systems language.

For me, C# and Swift replace the tasks at work were I in the past could have reached for D instead, mostly due to who is behind those languages, and I don't want to be that guy that leaves and is the one that knew the stack.

Re: D Programming Language

#59
post #20

D is like a forced meme at that point. Never has an old language gained traction, its all about the initial network effects created by excitement. No matter how much better it is from C now, C is slowly losing traction and its potential replacements already have up and running communities (Rust, zig etc)

Python was first released in 1991. It rumbled along for about 20 years until exploding in popularity with ML and the rise of data science.

Not really, back in 2003 when I joined CERN it was already the offical scripting language on ATLAS, our build pipeline at the time (CMT) used Python, there were Python trainings available for the staff, and it was a required skill for anyone working in Grid Computing.

I started using Python in version 1.6, there were already several O'Reilly books, and Dr.Dobbs issues dedicated to Python.

Re: D Programming Language

#60
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)?

D and Rust are on the opposite sides at dealing with memory safety. Rust ensures safety by constantly making you think about memory with its highly sophisticated compile-time checks. D, on the other hand, offers you to either employ a GC and forget about (almost) all memory-safety concerns or a block scoped opt-out with cowboy-style manual memory management.

D retains object-oriented programming but also allows functional programming, while Rust seems to be specifically designed for functional programming and does not allow OOP in the conventional sense.

I've been working with D for a couple of months now and I noticed that it's almost a no-brainer to port C/C++ code to D because it mostly builds on the same semantics. With Rust, porting a piece of code may often require rethinking the whole thing from scratch.

Post reply on HN