OT: C# now has ref and const ref return

Ethan gooberman at gmail.com
Wed Aug 7 10:45:44 UTC 2019


On Tuesday, 6 August 2019 at 11:59:04 UTC, Bert wrote:
> I'm about 10x as productive in other languages than D. It's not 
> the language itself as it is everything around it. It's great 
> for minor things like utilities or simple one offs but few in 
> the right mind will use D for anything major(as a serious 
> massive app targeted as the real public).

So this is a good point and a bad point rolled in to one.

Manu has mentioned VisualD, and his points are spot on. It's 
good, but I keep hitting rough edges. Associative arrays inside 
templated types don't display in the debugger for me, for example.

But being productive in other languages. Well.

This serious massive app targeted at the real public that I'm 
working on has the native component written in D. Server and 
client backends; and a runtime component that will be linked in 
to your program.

The only native UI framework that gives me the performance and 
quality I need is WPF.

Anyone that tries telling me that C# is a more protective 
language than in D only needs to take a look at my codebase to 
see just how much boilerplate my D code needs to generate for my 
C# code to be written as quickly as D code. Every time I try to 
use generics in C#, either the language or the .NET runtime 
quickly reminds me that generics were an afterthought and I often 
have to stop using generics and resort to writing D code that 
does the job the C# compiler should.

C# isn't at a point where I'd link it in to a major console game 
for runtime operations. return ref is good and all that, but 
there's still boxing and unboxing of even basic types that 
happens. Not to mention that to talk to any game codebase 
(outside of Unity games) requires marshalling and unmarshalling.

But on the other hand, I can load a PNG easily with C#. When I 
tried using libpng in D last year, the two (TWO) separate 
packages on dub didn't compile under the then-current DMD 
version. One of the packages was updated earlier this year, but 
it's too late, I'm using Adam Ruppe's PNG handler. That D has no 
quality control on what is a *CRITICAL* library these days is 
kinda insane.

So. My point - writing code in D is easy, and my project would 
not be where it is right now were it not for the deep 
introspection and metaprogramming techniques I'm using. 
Integrating D code in to the wider ecosystem, however, is where 
things get tricky.

Atila's point is spot on - it needs to be as simple as #include.


More information about the Digitalmars-d mailing list