-
-
Notifications
You must be signed in to change notification settings - Fork 421
Addition of C++ std::string, std::vector to D #1316
Conversation
Before I start off, I want to say this is genuinely an interesting PR. |
alias size_type = size_t; | ||
|
||
// Ctor/dtor | ||
pragma(mangle, "_ZNSsC1Ev") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe you've already mentioned this, but all these pragma(mangle)
declarations need to be removed. The compiler should mangle this for us, and if it doesn't, then raise a new issue. Someone will need to check compatibility with Windows too, which uses a completely different mangling ABI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes they need to go away. The bug is already reported and I'm also working on getting this fixed - it's a lot harder than I thought though.
With the new |
Thx for the ping @redstar. I'll update the PR within a few days. |
Any updates on this being merged? |
@Elronnd I don't think this can be merged before the name mangling is fixed. |
@gchatelet: |
I was not aware of a new ABI for c++ 11 strings. It might just be a name mangling issue. I suspect We could make the namespace conditional but then the manual mangling needs to be changed as well. Anyways, the mangling should be fixed, the manual override is simply a hack for the proof of concept. So if we want to be able to link against C++ libraries compiled with GCC5, we need something like:
|
@andralex Could you comment on the status of one of the scholarship students working on the STL interface? |
cc @Darredevil |
unfortunately a bit more complex than that:
[1]
We definitely need:
|
I believe the If there are several implementations (several sizes, behaviors) we need to make a call: support only the common case or have all the implementations and a way to select between them. |
You may be interested in this: http://fitzgeraldnick.com/2017/02/22/cpp-demangle.html |
Thx for the article @ZombineDev. I'll add that demangling is easier than mangling because you don't need to deal with the impedance mismatch between C++ and D semantic (class is ref semantic in D, static arrays are passed as pointers in C++ just to name a few). |
hi @gchatelet are you still interested in getting this accepted? i'd appreciate it. |
@mengu well unfortunately this is all blocked on the name mangling issue: and this is a tough one. I spent a lot of time on it already and now that I have a newborn... you know... |
Superseded by #2211 |
This is an early version serving as a basis for discussion since :
Also a few points to note :
mangling
string
std_string
as a opaque type with a different, simpler API, basically getters/setters from Dstring
.vector
version(none)
), it is not functional because of mangling issues.dependency on libstdc++
CRuntime_Glibc
.