Why is D unpopular?

H. S. Teoh hsteoh at quickfur.ath.cx
Wed May 18 20:12:20 UTC 2022


On Wed, May 18, 2022 at 07:57:31PM +0000, max haughton via Digitalmars-d wrote:
> On Wednesday, 18 May 2022 at 19:36:32 UTC, H. S. Teoh wrote:
[...]
> > Ah I got it, we have to preserve the C++ interface in order to
> > integrate with the LLVM/GCC backends, right?
> > 
> > In that case, if I were put in the same situation, I'd auto-generate
> > a .di from the C++ .h instead.  Basically, I'm wary of maintaining
> > two parallel versions of the same thing, because the chances of
> > human error causing them to go out of sync is just too high.  Let
> > the machine do what it's best at; leave the human to do what humans
> > are good at, which is NOT repetitive tasks that require high
> > accuracy.
[...]
> I think you have it backwards.
> 
> GCC and LDC both use the D frontend sources, but their glue code is
> written in C++. This means that they need C++ binding s *to* the
> frontend. A .di file would be pointless because there would be no one
> to consume it.

The .di is to force the compiler to abort with an error if the
corresponding D code doesn't match the C++ declarations. Well OK, I
don't know if .di would work, perhaps the .d declarations themselves
should be auto-generated. Or something like that.

Whichever direction you go, the idea is to observe SST.


T

-- 
Famous last words: I *think* this will work...


More information about the Digitalmars-d mailing list