Export ?

Jonathan M Davis jmdavisProg at gmx.com
Wed Apr 11 03:50:05 PDT 2012


On Wednesday, April 11, 2012 11:56:00 deadalnix wrote:
> Le 10/04/2012 19:44, Jonathan M Davis a écrit :
> > On Tuesday, April 10, 2012 19:36:06 deadalnix wrote:
> >> On this newsgroup with Jonathan M Davis, we started discussing export.
> >> As it was off topic, and as it was interesting, I wish to bring it here.
> >> 
> >> As most of you know, all symbol on posix systems are export, but not on
> >> windows. As D have an export keyword, the question is what to do with it.
> >> 
> >> The need for change in the UNIX world of this behavior exists, and some
> >> move has been made in direction of explicitly hiding symbols ( see
> >> http://gcc.gnu.org/wiki/Visibility ).
> > 
> > As I said in the other thread, I _hate_ export. It's one of Windows
> > largest
> > misfeatures IMHO. It drives me nuts when I have to deal with it in C++.
> > The
> > fact that Linux exports everything is _fantastic_. It's so much easier to
> > deal with. I'd _hate_ to see Linux or anything we do move in the
> > direction of what Windows has done.
> > 
> > - Jonathan M Davis
> 
> It isn't a misfeature. The link explain why it is interesting :
>   - It improves load time of DSO.
>   - Allow more optimizations.
>   - Reduce DSO size by 5% to 20% for C++. Considering how long mangling
> are in D, probably more for us.
>   - Reduce name collision (this one poorly apply to D, because the
> module system handle that quite nicely).
> 
> Additionally, it allow automatic finalization for non exported methods in D.
> 
> The drawback is having to explicitely export. I think it worth it,
> especially considering « export: » is an available solution. A compiler
> switch is also an option.
> 
> BTW, Linux is moving in that direction, for the advantages given above.
> Some other posix systems also does that already.

Honestly, I don't care what list of benefits you can come up with for having to 
explicitly export symbols. I am sick and tired of having to deal with build 
breakages due to unexported symbols in C++ on Windows. It is really, reallly, 
really annoying. It's a usability nightmare as far as I'm concerned, and I 
don't want to see it spread any more than I want to see cancer spread.

As far as I'm concerned, Linux got this _right_ and Windows got it completely 
wrong, and I do _not_ want to see export being used in D any further than it 
is. It's bad enough that the export keyword exists at all.

- Jonathan M Davis


More information about the Digitalmars-d mailing list