compatibility of c++ and d on the level of llvm bytecode

Kai Nacke via digitalmars-d-ldc digitalmars-d-ldc at puremagic.com
Mon May 16 22:57:12 PDT 2016


On Monday, 16 May 2016 at 13:20:12 UTC, egordeev wrote:
> Hello, everyone,
> just curious, can we achive compatibility of c++ programs with 
> d programms, i.e. can we use c++ functions, classes, etc. in d 
> programs relying on compatibility of bytecodes, generated by 
> Clang and LDC, and not on the level of ABI?
> If so, what are the obstacle if they are exist?

Hi egordeev,

it depends on your goal. The LLVM bytecode is not independent of 
the target system. E.g. differences in the ABI are also reflected 
in the byte code.

But as David said: in most cases you can work around problems 
using a bitcast.

Regards,
Kai


More information about the digitalmars-d-ldc mailing list