Thread overview | ||||||
---|---|---|---|---|---|---|
|
May 16, 2016 compatibility of c++ and d on the level of llvm bytecode | ||||
---|---|---|---|---|
| ||||
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? |
May 16, 2016 Re: compatibility of c++ and d on the level of llvm bytecode | ||||
---|---|---|---|---|
| ||||
Posted in reply to egordeev | On 16 May 2016, at 14:20, egordeev via digitalmars-d-ldc wrote:
> 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?
Clang and LDC will almost certainly differ in the format of the byte code they emit. However, it should always be possible to just bitcast the values (data, function pointers) appropriately to make them compatible.
— David
|
May 17, 2016 Re: compatibility of c++ and d on the level of llvm bytecode | ||||
---|---|---|---|---|
| ||||
Posted in reply to egordeev | 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
|
May 25, 2016 Re: compatibility of c++ and d on the level of llvm bytecode | ||||
---|---|---|---|---|
| ||||
Posted in reply to egordeev | 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?
Have a look at calypso which integrates ldc and clang.
|
Copyright © 1999-2021 by the D Language Foundation