digitalmars.D - C++ Binding / extern(C++)
- Dan (6/6) Mar 28 2007 I was just discussing how difficult it would be for someone to write C++...
- Gregor Richards (8/19) Mar 28 2007 There already is a project to automatically bind C++ to D, it's just not...
- Don Clugston (3/4) Mar 29 2007 It amazes me that most people don't seem to realise that C++ is
- =?ISO-8859-1?Q?Jari-Matti_M=E4kel=E4?= (3/7) Mar 29 2007 Yeah, even this (http://www.mozilla.org/hacking/portable-cpp.html) tells
- Don Clugston (7/15) Mar 29 2007 Great link.
- Frits van Bommel (4/7) Mar 29 2007 Wait, *you're* the guy that wrote that? Great article. Even though I
- Johan Granberg (4/13) Mar 29 2007 I agree with all above, great article :P.
- Don Clugston (3/11) Mar 29 2007 I'm intrigued. What did you imagine? Something a bit more exotic?
- Bill Baxter (4/18) Mar 29 2007 For some reason I expected Jim Blinn's twin:
- kris (4/31) Mar 29 2007 lol
- Frits van Bommel (3/21) Mar 30 2007 Yeah, something like that. Except with less hair below his face and more...
- Don Clugston (3/25) Mar 30 2007 Aarghh. The mystique is shattered.
- David B. Held (5/13) Mar 29 2007 That's a 9 year old document last updated 6 years ago. C++ has come a
- =?ISO-8859-1?Q?Jari-Matti_M=E4kel=E4?= (5/18) Mar 29 2007 Ah, yes - didn't notice that. I just saw "Last modified January 22,
- James Dennett (14/21) Mar 29 2007 Just as C compilers are not always ABI-compatible. It's
- Dan (2/9) Mar 29 2007 That simple, huh? I'll look up the project, thanks for the link. I won...
- Alexander Panek (3/13) Mar 29 2007 According to the fact, that the author himself gave you the link, it
I was just discussing how difficult it would be for someone to write C++ bindings to a project on the dsource forums, and remembered how I wanted to use Ogre with D and wished Sinbad was done... and how DirectFB is done in C++... Has anyone figured out how to bind D to C++ on any include/importable level? (source, AST, OBJ files, extern'ing to the *.h files) If they have, maybe we can set up a project to automatically bind C++ projects in, and Walter might add it to his linker? For example, matching scrambled names by scrambling a copy of the D ones, matching it, binding it? Or perhaps if Walter allowed extern(C++) by matching the identifiers in the AST's and passed the extern(C++) segment to the digital mars C++ compiler with the shared identifiers? Just my thoughts...
Mar 28 2007
Dan wrote:I was just discussing how difficult it would be for someone to write C++ bindings to a project on the dsource forums, and remembered how I wanted to use Ogre with D and wished Sinbad was done... and how DirectFB is done in C++... Has anyone figured out how to bind D to C++ on any include/importable level? (source, AST, OBJ files, extern'ing to the *.h files) If they have, maybe we can set up a project to automatically bind C++ projects in, and Walter might add it to his linker? For example, matching scrambled names by scrambling a copy of the D ones, matching it, binding it? Or perhaps if Walter allowed extern(C++) by matching the identifiers in the AST's and passed the extern(C++) segment to the digital mars C++ compiler with the shared identifiers? Just my thoughts...There already is a project to automatically bind C++ to D, it's just not particularly complete or accurate. http://www.dsource.org/projects/bcd/ The method is simple: Generate a C binding to the C++, then generate a D binding to the C. - Gregor Richards PS: extern(C++) is a terrible idea. It wouldn't be cross-compatible.
Mar 28 2007
Gregor Richards wrote:PS: extern(C++) is a terrible idea. It wouldn't be cross-compatible.It amazes me that most people don't seem to realise that C++ is incompatible with C++.
Mar 29 2007
Don Clugston kirjoitti:Gregor Richards wrote:Yeah, even this (http://www.mozilla.org/hacking/portable-cpp.html) tells a lot. I don't know, whether I should laugh or cry.PS: extern(C++) is a terrible idea. It wouldn't be cross-compatible.It amazes me that most people don't seem to realise that C++ is incompatible with C++.
Mar 29 2007
Jari-Matti Mäkelä wrote:Don Clugston kirjoitti:Great link. It was as a result of writing this... http://www.codeproject.com/cpp/FastDelegate.asp ...that I switched to D. It seems that even the compiler writers don't know this stuff (several emailed me about it). C++ portability is a complete fiasco.Gregor Richards wrote:Yeah, even this (http://www.mozilla.org/hacking/portable-cpp.html) tells a lot. I don't know, whether I should laugh or cry.PS: extern(C++) is a terrible idea. It wouldn't be cross-compatible.It amazes me that most people don't seem to realise that C++ is incompatible with C++.
Mar 29 2007
Don Clugston wrote:It was as a result of writing this... http://www.codeproject.com/cpp/FastDelegate.aspWait, *you're* the guy that wrote that? Great article. Even though I never actually used the technique it presents I learned a lot from it. Also, like Walter, you look nothing like I imagined :P.
Mar 29 2007
Frits van Bommel wrote:Don Clugston wrote:I agree with all above, great article :P. Ironically I found that article when trying to learn how to use pointers to member functions and it helped me learn how to use them adequately. :DIt was as a result of writing this... http://www.codeproject.com/cpp/FastDelegate.aspWait, *you're* the guy that wrote that? Great article. Even though I never actually used the technique it presents I learned a lot from it. Also, like Walter, you look nothing like I imagined :P.
Mar 29 2007
Frits van Bommel wrote:Don Clugston wrote:Thanks! I learnt a lot from it too...It was as a result of writing this... http://www.codeproject.com/cpp/FastDelegate.aspWait, *you're* the guy that wrote that? Great article. Even though I never actually used the technique it presents I learned a lot from it.Also, like Walter, you look nothing like I imagined :P.I'm intrigued. What did you imagine? Something a bit more exotic?
Mar 29 2007
Don Clugston wrote:Frits van Bommel wrote:For some reason I expected Jim Blinn's twin: http://vis.computer.org/Vis2003/session/capstone.html --bbDon Clugston wrote:Thanks! I learnt a lot from it too...It was as a result of writing this... http://www.codeproject.com/cpp/FastDelegate.aspWait, *you're* the guy that wrote that? Great article. Even though I never actually used the technique it presents I learned a lot from it.Also, like Walter, you look nothing like I imagined :P.I'm intrigued. What did you imagine? Something a bit more exotic?
Mar 29 2007
Bill Baxter wrote:Don Clugston wrote:lol That FastDelegate article is really a great one, and I agree about the JamesBlinn notion :-)Frits van Bommel wrote:For some reason I expected Jim Blinn's twin: http://vis.computer.org/Vis2003/session/capstone.html --bbDon Clugston wrote:Thanks! I learnt a lot from it too...It was as a result of writing this... http://www.codeproject.com/cpp/FastDelegate.aspWait, *you're* the guy that wrote that? Great article. Even though I never actually used the technique it presents I learned a lot from it.Also, like Walter, you look nothing like I imagined :P.I'm intrigued. What did you imagine? Something a bit more exotic?
Mar 29 2007
Bill Baxter wrote:Don Clugston wrote:Yeah, something like that. Except with less hair below his face and more above. And perhaps a bit younger.Frits van Bommel wrote:For some reason I expected Jim Blinn's twin: http://vis.computer.org/Vis2003/session/capstone.htmlDon Clugston wrote:Thanks! I learnt a lot from it too...It was as a result of writing this... http://www.codeproject.com/cpp/FastDelegate.aspWait, *you're* the guy that wrote that? Great article. Even though I never actually used the technique it presents I learned a lot from it.Also, like Walter, you look nothing like I imagined :P.I'm intrigued. What did you imagine? Something a bit more exotic?
Mar 30 2007
Frits van Bommel wrote:Bill Baxter wrote:Aarghh. The mystique is shattered. Nobody will take me seriously now.Don Clugston wrote:Yeah, something like that. Except with less hair below his face and more above. And perhaps a bit younger.Frits van Bommel wrote:For some reason I expected Jim Blinn's twin: http://vis.computer.org/Vis2003/session/capstone.htmlDon Clugston wrote:Thanks! I learnt a lot from it too...It was as a result of writing this... http://www.codeproject.com/cpp/FastDelegate.aspWait, *you're* the guy that wrote that? Great article. Even though I never actually used the technique it presents I learned a lot from it.Also, like Walter, you look nothing like I imagined :P.I'm intrigued. What did you imagine? Something a bit more exotic?
Mar 30 2007
Jari-Matti Mäkelä wrote:Don Clugston kirjoitti:That's a 9 year old document last updated 6 years ago. C++ has come a ways since then, but I'm sure there would still be plenty to leave on the list. DaveGregor Richards wrote:Yeah, even this (http://www.mozilla.org/hacking/portable-cpp.html) tells a lot. I don't know, whether I should laugh or cry.PS: extern(C++) is a terrible idea. It wouldn't be cross-compatible.It amazes me that most people don't seem to realise that C++ is incompatible with C++.
Mar 29 2007
David B. Held wrote:Jari-Matti Mäkelä wrote:Ah, yes - didn't notice that. I just saw "Last modified January 22, 2007" on the bottom of the page. But wait.. they have actually updated it after 2001. I'm not sure how true that is anymore, but it's still interesting to see a page like this.Don Clugston kirjoitti:That's a 9 year old document last updated 6 years ago. C++ has come a ways since then, but I'm sure there would still be plenty to leave on the list.Gregor Richards wrote:Yeah, even this (http://www.mozilla.org/hacking/portable-cpp.html) tells a lot. I don't know, whether I should laugh or cry.PS: extern(C++) is a terrible idea. It wouldn't be cross-compatible.It amazes me that most people don't seem to realise that C++ is incompatible with C++.
Mar 29 2007
Jari-Matti Mäkelä wrote:Don Clugston kirjoitti:Just as C compilers are not always ABI-compatible. It's just that ABIs for C are more standard than for C++. There have been, for example, good quality C compilers that used name mangling to achieve type-safe linkage.Gregor Richards wrote:PS: extern(C++) is a terrible idea. It wouldn't be cross-compatible.It amazes me that most people don't seem to realise that C++ is incompatible with C++.Yeah, even this (http://www.mozilla.org/hacking/portable-cpp.html) tells a lot. I don't know, whether I should laugh or cry.I cry; most of what it says doesn't apply to compilers from about the last decade. This is what happens when languages are hugely successful (in terms of installed base) -- they gain legacy burdens. If D does things well, you don't need to spread FUD about other languages. By all means compare, but naive bashing of other languages doesn't make the D community look healthy. -- James
Mar 29 2007
Gregor Richards Wrote:There already is a project to automatically bind C++ to D, it's just not particularly complete or accurate. http://www.dsource.org/projects/bcd/ The method is simple: Generate a C binding to the C++, then generate a D binding to the C.That simple, huh? I'll look up the project, thanks for the link. I wonder if it's still active...
Mar 29 2007
Dan wrote:Gregor Richards Wrote:According to the fact, that the author himself gave you the link, it might still be so. <g>There already is a project to automatically bind C++ to D, it's just not particularly complete or accurate. http://www.dsource.org/projects/bcd/ The method is simple: Generate a C binding to the C++, then generate a D binding to the C.That simple, huh? I'll look up the project, thanks for the link. I wonder if it's still active...
Mar 29 2007