digitalmars.D.learn - C++ Interop
- qznc (16/16) Jan 05 2018 I'm exploring [0] C++ interop after watching Walter's
- Timothee Cour (4/17) Jan 05 2018 see also https://github.com/Syniurge/Calypso/ although I'm having lots
- Seb (4/7) Jan 06 2018 I know about this:
- Seb (5/13) Jan 06 2018 And:
- qznc (6/22) Jan 06 2018 It would be great to have std::vector and std::string out of the
- Andres Clari (2/7) Jan 06 2018 +1 Supporting std::vector and std::string would be a major help
- Laeeth Isharc (4/12) Jan 07 2018 Binderoo currently is Windows only. I am talking to Ethan about
- Mengu (3/19) Jan 06 2018 is C++ support in LDC better than what we have with DMD?
I'm exploring [0] C++ interop after watching Walter's presentation [1]. I hit a block with classes as template parameters. This means vector<int> works, but vector<Foo> does not. D seems to map vector!Foo to vector<Foo*>. Likewise shared_ptr<Foo> is a problem. Any way to fix that on the D side? The ugly workaround is to adapt the C++ code. I understand that this mapping makes sense for function calls because bar(Foo f) in D maps to bar(Foo *f) in C++. And C++ bar(Foo f) has no equivalent in D because classes are reference types. On a related note, C++ interop requires to redeclare or even reimplement C++ code. Has anybody started a libcpp-in-d project? I'm looking for basics like vector and string. [0] https://github.com/qznc/d-cpptest [1] https://youtu.be/IkwaV6k6BmM
Jan 05 2018
see also https://github.com/Syniurge/Calypso/ although I'm having lots of issues using it on OSX On Fri, Jan 5, 2018 at 9:02 AM, qznc via Digitalmars-d-learn <digitalmars-d-learn puremagic.com> wrote:I'm exploring [0] C++ interop after watching Walter's presentation [1]. I hit a block with classes as template parameters. This means vector<int> works, but vector<Foo> does not. D seems to map vector!Foo to vector<Foo*>. Likewise shared_ptr<Foo> is a problem. Any way to fix that on the D side? The ugly workaround is to adapt the C++ code. I understand that this mapping makes sense for function calls because bar(Foo f) in D maps to bar(Foo *f) in C++. And C++ bar(Foo f) has no equivalent in D because classes are reference types. On a related note, C++ interop requires to redeclare or even reimplement C++ code. Has anybody started a libcpp-in-d project? I'm looking for basics like vector and string. [0] https://github.com/qznc/d-cpptest [1] https://youtu.be/IkwaV6k6BmM
Jan 05 2018
On Friday, 5 January 2018 at 13:02:12 UTC, qznc wrote:I'm exploring [0] C++ interop after watching Walter's presentation [1]. [...]I know about this: https://github.com/Remedy-Entertainment/binderoo https://github.com/dlang/druntime/pull/1802
Jan 06 2018
On Saturday, 6 January 2018 at 11:17:56 UTC, Seb wrote:On Friday, 5 January 2018 at 13:02:12 UTC, qznc wrote:And: https://github.com/dlang/druntime/pull/1316 Also I think Ian ( ibuclaw) and Razvan7 are currently working on a header generation tool from D sources to C++ headers.I'm exploring [0] C++ interop after watching Walter's presentation [1]. [...]I know about this: https://github.com/Remedy-Entertainment/binderoo https://github.com/dlang/druntime/pull/1802
Jan 06 2018
On Saturday, 6 January 2018 at 11:20:01 UTC, Seb wrote:On Saturday, 6 January 2018 at 11:17:56 UTC, Seb wrote:It would be great to have std::vector and std::string out of the box in D, but putting it into druntime? Druntime is supposed to be shared among all frontends, isn't it? GCC and Clang probably do not have equivalent vector/string classes that the same D code can be used.On Friday, 5 January 2018 at 13:02:12 UTC, qznc wrote:And: https://github.com/dlang/druntime/pull/1316 Also I think Ian ( ibuclaw) and Razvan7 are currently working on a header generation tool from D sources to C++ headers.I'm exploring [0] C++ interop after watching Walter's presentation [1]. [...]I know about this: https://github.com/Remedy-Entertainment/binderoo https://github.com/dlang/druntime/pull/1802
Jan 06 2018
On Saturday, 6 January 2018 at 13:51:54 UTC, qznc wrote:It would be great to have std::vector and std::string out of the box in D, but putting it into druntime? Druntime is supposed to be shared among all frontends, isn't it? GCC and Clang probably do not have equivalent vector/string classes that the same D code can be used.+1 Supporting std::vector and std::string would be a major help
Jan 06 2018
On Saturday, 6 January 2018 at 11:17:56 UTC, Seb wrote:On Friday, 5 January 2018 at 13:02:12 UTC, qznc wrote:Binderoo currently is Windows only. I am talking to Ethan about extending it to work on Linux too. Let me know if any other features helpful to add (no promises, but we can see).I'm exploring [0] C++ interop after watching Walter's presentation [1]. [...]I know about this: https://github.com/Remedy-Entertainment/binderoo https://github.com/dlang/druntime/pull/1802
Jan 07 2018
On Friday, 5 January 2018 at 13:02:12 UTC, qznc wrote:I'm exploring [0] C++ interop after watching Walter's presentation [1]. I hit a block with classes as template parameters. This means vector<int> works, but vector<Foo> does not. D seems to map vector!Foo to vector<Foo*>. Likewise shared_ptr<Foo> is a problem. Any way to fix that on the D side? The ugly workaround is to adapt the C++ code. I understand that this mapping makes sense for function calls because bar(Foo f) in D maps to bar(Foo *f) in C++. And C++ bar(Foo f) has no equivalent in D because classes are reference types. On a related note, C++ interop requires to redeclare or even reimplement C++ code. Has anybody started a libcpp-in-d project? I'm looking for basics like vector and string. [0] https://github.com/qznc/d-cpptest [1] https://youtu.be/IkwaV6k6BmMis C++ support in LDC better than what we have with DMD? i did checkout your code btw and could not enjoy it more. :)
Jan 06 2018