Future of memory management in D

H. S. Teoh hsteoh at quickfur.ath.cx
Wed Nov 17 01:32:50 UTC 2021


On Wed, Nov 17, 2021 at 01:15:21AM +0000, zjh via Digitalmars-d wrote:
> On Wednesday, 17 November 2021 at 01:02:46 UTC, H. S. Teoh wrote:
> > We already can.  I have many projects that call C libraries (not so
> > much C++ because of incompatibilities between C++ and D templates),
> > and it works fine.
> 
> The abstraction of C is too raw. D needs the ability to own the whole
> standard library without GC, so as to survive under `low hardware
> conditions`.

Have you heard about -betterC? ;-)


> There are many C++ users, so you have to provide C++ binding.

The past few years Walter was busy implementing binding to C++ classes.
I haven't kept up with the current status of that, but AFAIK it has been
implemented to some extent.

I haven't seen the crowd of C++ programmers flocking to D yet.


> Now, there are many `Rust` users, and they may have to be binded.
> Their is mine. After all, the D user base is too small. You have to
> bind with others.

AFAIK, most Rust users are ex-C/C++ users.  If they have already chosen
Rust over D, good luck convincing them to switch again.

D already has bindings for other languages.  The most important one is
C, since that's the de facto baseline for basically every relevant OS
out there these days.  C++ is partially supported (you have extern(C++)
classes, dpp, etc.).  We have Java support (thanks to Adam's jni.d,
which uses D's metaprogramming abilities to make it so nice to interface
with Java that I was actually tempted to start using Java again!), and
somebody wrote an Excel binding too.

Of course, these are in various states of polishedness, and probably
could use more work to round out the experience.  It's easy to say "we
need X, we need Y, we should do Z".  But talk doesn't make anything
happen; what we have today is because *somebody* decided to actually
write code to make it happen instead of posting suggestions to unending
threads on the forum. ;-)


T

-- 
"Hi." "'Lo."


More information about the Digitalmars-d mailing list