C++ or D?

evilrat evilrat666 at gmail.com
Wed Dec 23 19:00:14 UTC 2020


On Wednesday, 23 December 2020 at 18:03:56 UTC, frame wrote:
>
> It's not the problem mentioned but I had to struggle with DLLs 
> and D's Variant-type. The problem is that Variant uses TypeInfo 
> which does not pass DLL boundaries correctly so that int != int 
> in runtime even it's in fact a simple int.
>
> If you need to exchange unknown data between a DLL and your 
> application you need to get a workaround and cannot use that 
> elsewhere settled nice feature. But it's a Windows specific 
> issue - it works as expected on other systems.

Which is basically same as in C++, despite the fact it does have 
real working SO/DLL runtime's many large projects have their own 
RTTI implementation. LLVM has its own RTTI because standard type 
info is "inefficient", Unreal Engine has its own, IIRC Qt too has 
its own, etc...

Same thing with D Variant, some people say it is "inefficient"... 
so we ended up having multiple libraries.

Not saying anything about how good or bad all this, just the 
facts.


More information about the Digitalmars-d-learn mailing list