DIP61: Add namespaces to D

Andrej Mitrovic via Digitalmars-d digitalmars-d at puremagic.com
Sat Apr 26 11:57:31 PDT 2014


On Saturday, 26 April 2014 at 18:51:16 UTC, Walter Bright wrote:
> On 4/26/2014 11:21 AM, Dicebot wrote:
>> Namespaces also don't solve any problem for that can't be 
>> already elegantly
>> solved.
>
> There isn't any existing elegant solution to calling a C++ 
> function in a namespace.

Can I make a note about something? The C++ committee keeps adding 
new features to C++, libraries are probably going to start using 
those features. So when C++ gets feature X and D has to have link 
compatibility with C++, will we be forced to invent even more 
syntax just to be able to link with the latest C++1x**?

I just really doubt C++ and D will be able to seamlessly 
interoperate because you can now match namespaces. That's the 
freakin' tip of the iceberg. There's so much more that you can't 
do, such as:

- Use class objects by value in D
- Manage memory in a reliable way across language boundaries (and 
in a usable way, meaning D users shouldn't have to call 
new/delete)
- Handle exceptions being thrown across language boundaries

I fear like we're trying to accomplish with C++ what C++ has 
tried to accomplish with C, meaning it wants to become a superset 
and wrap another language. Shoehorning stuff into D just to make 
linking with C++ easier looks like the wrong approach to me.


More information about the Digitalmars-d mailing list