OT: C# now has ref and const ref return

Ethan gooberman at gmail.com
Wed Aug 7 13:54:46 UTC 2019


On Wednesday, 7 August 2019 at 12:36:53 UTC, Bert wrote:
> But you are one person who has decided to use D in that regard, 
> and funny how you didn't strictly do it in D alone! That 
> actually says a lot about D.

Actually, it says a lot more about modern software development.

I don't care what language a library was written in. I 100% 
don't. It's irrelevant. All I care about is if it has a C/C++ ABI 
that I can hook in to.

.NET assemblies can be understood in any .NET language. The 
approach I've taken with Binderoo is to make Binderoo libraries 
generate an interface for any supported language. Similar 
approach to .NET there, self describing libraries that don't rely 
on the language it was originally written in.

Name mangling is a well understood and defined thing on any 
modern. It's feasible that one could write a .h/.di/.cs/etc 
definition generator given any arbitrary compiled .dll/.so/.dylib.

There's no reason a WPF-quality framework couldn't be written in 
D. But why bother if I can just bind to one?

Take my point one step further: Why has no one written a 
WPF-quality visual framework in C or C++? Or, if they have, why 
is it not more well known and in wider use?

(When I say WPF quality. Understand that its standard widgets can 
be customised in a HTML-style manner. All I need is an easily 
customisable layout engine that's native. HTML5 is not performant 
enough for my needs yet.)

> .NET is "complete" basically anything you want to do and you 
> can do it, it has a few things that are not, it's almost entire 
> performance related and meta programming related. If C# had D's 
> performance and D's meta programing I would be using C#. You 
> would be too... and that is a problem for D, not C#.

I've often said around these parts that the .NET runtime is the 
best in class. And it is not at all dependent on C#. It just 
expects your compiler to target .NET.

We have LDC. Someone sitting down and starting up D.NET and 
integrating it in to the .NET Core ecosystem would be fantastic. 
Then you could write D code in the .NET environment and get 
access to the .NET runtime.




More information about the Digitalmars-d mailing list