Live data from Hacker News

D Programming Language

dlang.org

31–40 of 278 posts

Re: D Programming Language

#31

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 incredibly difficult to handle.

Tbh - this is with good reason, 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, both for the compiler and the programmer.

And it's a simple case, OOP offers tons of tools to make the programmers job even more difficult - virtual methods, object chains with callbacks, etc. It's just not a clean programming style.

Edit: Just to make it clear, I am not pointing out these problems, to sell you or even imply that I have the solution. I'm not saying programming style X is better.

Re: D Programming Language

#32

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)

Not everything needs to have "traction", "excitement" or the biggest community. D is a useful, well designed programming language that many thousands of people in this vast world enjoy using, and if you enjoy it too, you can use it. Isn't that nice?

Re: D Programming Language

#33
post #27
post #13

Earlier quoted context omitted.

Yeah, that is why carpenters are still around and no one buys Ikea.

> Yeah, that is why carpenters are still around and no one buys Ikea. I'm sorry, what? Are you suggesting that Ikea made carpenters obsolete? It's been less than 6 months since last I had a professional carpenter do work in my house. He seemed very real. And charged very real prices. This despite the fact that I've got lots of Ikea stuff.

Compared to before, not a lot of carpenters/furniture makers are left. This is due to automation.

Re: D Programming Language

#34
post #4

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

For those curious what ownership and borrowing looks like in D: https://dlang.org/blog/2019/07/15/ownership-and-borrowing-in...

This is a somewhat simplistic view of ownership and borrowing for modern programming languages.

Pointers are not the only 'pointer's to resources. You can have handles specific to your codebase or system, you can have indices to objects in some flat array that the rest of your codebase uses, even temporary file names.

An object oriented (or 'multi paradigm') language has to account for these and not just literal pointers.

This is handled reasonably well both in Rust and C++. (In the spirit of avoiding yet another C++ vs Rust flamewar here, yes the semantics are different, no it doesn not make sense for C++ to adopt Rust semantics)

Re: D Programming Language

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

Python crossed the chasm in the early 2000s with scripting, web applications, and teaching. Yes, it's riding an ML rocket, but it didn't become popular because it was used for ML, it was chosen for ML because it was popular.

Re: D Programming Language

#36
post #17

[flagged]

Genuinely curious as I'm relatively new compared to the time of inception of this language. Can you cite the reasons why people didn't choose D?

It was competing with C and Java when it came out. People who like C will not use a language with garbage collection, even one that allows you to not use it. Against Java, it was a losing battle due to Java being backed by a giant (Sun , then Oracle) and basically taking the world by storm. Then there were also license problems in early versions of D, and two incompatible and competing standard libraries dividing the community. By the time all these problems were fixed, like a decade ago, it was already too late to make a comeback. Today D is a nice language with 3 different compilers with different strengths, one very fast, one produces faster results, and one also does that by works in the GCC ecosystem. That’s something few languages have. D even has a betterC mode now which makes it very good as a C replacement, with speed and size equivalent or better than a C equivalent binary… and D has the arguably best meta programming capabilities of any language that is not a Lisp, including Zig. But no one seems to care anymore as all the hotness is now with Rust and Zig in the systems languages space.

Re: D Programming Language

#37

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…

I work at a D company. We tend to use OOP only for state owners with strict dependencies, so it's rare to even get cycles. It is extremely useful for modeling application state. However, all the domain data is described by immutable values and objects are accessed via parameters as much as fields.

When commandline apps were everywhere, people dreamed of graphical interfaces. Burdened by having to also do jobs that it was bad at, the commandline got a bad reputation. It took the dominance of the desktop for commandline apps to find their niche.

In a similar way, OOP is cursed by its popularity. It has to become part of a mixed diet so that people can put it where it has advantages, and it does have advantages.

Re: D Programming Language

#38
post #21
post #16

Earlier quoted context omitted.

Is your proposition that programmers are now incapable of writing code?

Eventually yes, when incapable becomes a synonymous with finding a job in an AI dominated software factory industry. Enterprise CMS deployment projects have already dropped amount of assets teams, translators, integration teams, backend devs, replaced by a mix of AI, SaaS and iPaaS tools. Now the teams are a fraction of the size they used to be like five years ago. Fear not, there will be always a place for the few o…

Same for ERP/CRM/HRM and some financial systems ; all systems that were heavy 'no-code' (or a lot of configuration with knobs and switches rather than code) before AI are now just going to lose their programmers (and the other roles); the business logic / financial calcs etc were already done by other people upfront in excel, visio etc ; now you can just throw that into Claude Code. These systems have decades of rigid code practices so there is not a lot of architecting/design to be done in the first place.

Re: D Programming Language

#39

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…

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 especially true when introducing certain theoretical concepts that facilitate working with IO and state, such as Monad Transformers.

Re: D Programming Language

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

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 early 2010s when almost every startup was either ruby on rails or django. Then again in the mid 2010s when "data science" got popular with pandas. Then again in the end of 2010s with ML. Then again in the 2020s with LLMs. Every time people eventually drop it for something else. It's arguably in a much better place with types, asyncio, and much better ecosystem in general these days than it was back then. As someone who worked on developer tools and devops for most of the time, I always dread dealing with python developers though tbh.

Post reply on HN