plans for interfacing to C++

2012-01-08 Thread Trass3r
There were some discussions about adding namespace support with something like extern(C++, namespace) IIRC. Don't know the result though. Then there's this small patch (http://d.puremagic.com/issues/show_bug.cgi?id=4620) which allows very interesting stuff, even simple templates. It's rotti

Re: plans for interfacing to C++

2012-01-09 Thread Walter Bright
On 1/8/2012 7:54 PM, Trass3r wrote: There were some discussions about adding namespace support with something like extern(C++, namespace) IIRC. Don't know the result though. Then there's this small patch (http://d.puremagic.com/issues/show_bug.cgi?id=4620) which allows very interesting stuff, ev

Re: plans for interfacing to C++

2012-01-09 Thread Zachary Lund
How would this work exactly? Especially on Windows, libraries tend to not be compatible with each other. Will a C++ library be required to be compiled and linked with a certain toolset? On 01/09/2012 03:16 AM, Walter Bright wrote: On 1/8/2012 7:54 PM, Trass3r wrote: There were some discussion

Re: plans for interfacing to C++

2012-01-09 Thread deadalnix
Le 09/01/2012 04:54, Trass3r a écrit : There were some discussions about adding namespace support with something like extern(C++, namespace) IIRC. Don't know the result though. Then there's this small patch (http://d.puremagic.com/issues/show_bug.cgi?id=4620) which allows very interesting stuff,

Re: plans for interfacing to C++

2012-01-09 Thread Walter Bright
On 1/9/2012 1:25 AM, Zachary Lund wrote: How would this work exactly? Especially on Windows, libraries tend to not be compatible with each other. Will a C++ library be required to be compiled and linked with a certain toolset? Yes, as it is already.

Re: plans for interfacing to C++

2012-01-09 Thread Martin Nowak
Am 09.01.2012, 04:54 Uhr, schrieb Trass3r : There were some discussions about adding namespace support with something like extern(C++, namespace) IIRC. Don't know the result though. Then there's this small patch (http://d.puremagic.com/issues/show_bug.cgi?id=4620) which allows very intere

Re: plans for interfacing to C++

2012-01-09 Thread Trass3r
There were some discussions about adding namespace support with something like extern(C++, namespace) IIRC. Don't know the result though. Hmm another difficulty is how to switch between mangling schemes.

Re: plans for interfacing to C++

2012-01-09 Thread Trass3r
Then there's this small patch (http://d.puremagic.com/issues/show_bug.cgi?id=4620) which allows very interesting stuff, even simple templates. It's rotting. Wanna do a pull request for it? Just wanted to point at it. I'd like to have some discussion. See Martin Nowak's post for example. In the

Re: plans for interfacing to C++

2012-01-09 Thread Zachary Lund
On 01/09/2012 06:36 AM, Trass3r wrote: There were some discussions about adding namespace support with something like extern(C++, namespace) IIRC. Don't know the result though. Hmm another difficulty is how to switch between mangling schemes. Given Walter's comment, I don't think they plan to

Re: plans for interfacing to C++

2012-01-09 Thread Michel Fortin
On 2012-01-09 12:36:35 +, Trass3r said: There were some discussions about adding namespace support with something like extern(C++, namespace) IIRC. Don't know the result though. Hmm another difficulty is how to switch between mangling schemes. One thing that could be done is instead o

Re: plans for interfacing to C++

2012-01-09 Thread Trass3r
On Monday, 9 January 2012 at 18:04:58 UTC, Michel Fortin wrote: Hmm another difficulty is how to switch between mangling schemes. One thing that could be done is instead of the namespace argument, have a mangled name argument. Then use CTFE to build the mangled name (if you want to). This w

Re: plans for interfacing to C++

2012-01-10 Thread deadalnix
Le 09/01/2012 19:19, Trass3r a écrit : On Monday, 9 January 2012 at 18:04:58 UTC, Michel Fortin wrote: Hmm another difficulty is how to switch between mangling schemes. One thing that could be done is instead of the namespace argument, have a mangled name argument. Then use CTFE to build the m

Re: plans for interfacing to C++

2012-01-10 Thread sclytrack
On 01/10/2012 10:28 AM, deadalnix wrote: Le 09/01/2012 19:19, Trass3r a écrit : On Monday, 9 January 2012 at 18:04:58 UTC, Michel Fortin wrote: Hmm another difficulty is how to switch between mangling schemes. One thing that could be done is instead of the namespace argument, have a mangled n

Re: plans for interfacing to C++

2012-01-10 Thread Martin Nowak
On Tue, 10 Jan 2012 10:28:54 +0100, deadalnix wrote: Le 09/01/2012 19:19, Trass3r a écrit : On Monday, 9 January 2012 at 18:04:58 UTC, Michel Fortin wrote: Hmm another difficulty is how to switch between mangling schemes. One thing that could be done is instead of the namespace argument, ha

Re: plans for interfacing to C++

2012-01-10 Thread Michel Fortin
On 2012-01-10 09:28:54 +, deadalnix said: Le 09/01/2012 19:19, Trass3r a écrit : On Monday, 9 January 2012 at 18:04:58 UTC, Michel Fortin wrote: Hmm another difficulty is how to switch between mangling schemes. One thing that could be done is instead of the namespace argument, have a ma

Re: plans for interfacing to C++

2012-01-10 Thread Trass3r
On Tuesday, 10 January 2012 at 12:09:14 UTC, Michel Fortin wrote: Another idea which would be much less verbose: extern(C++, gccmangle) void foo(); Here, gccmangle is a CTFE-capable function that'd be called like this: gccmangle("foo"); So if you need a namespace arg

Re: plans for interfacing to C++

2012-01-10 Thread Trass3r
On Tuesday, 10 January 2012 at 09:27:03 UTC, deadalnix wrote: Le 09/01/2012 19:19, Trass3r a écrit : On Monday, 9 January 2012 at 18:04:58 UTC, Michel Fortin wrote: Or maybe it should be a pragma instead. Interesting idea. But how to do it properly? A namespace or a class may have lots of fun