Export ?

Manu turkeyman at gmail.com
Wed Apr 11 04:29:42 PDT 2012


On 11 April 2012 13:50, Jonathan M Davis <jmdavisProg at gmx.com> wrote:

> 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.
>

Apply the same rules to Linux, and it'll never bother you again. It's the
only solution, you can't possibly influence Microsoft to apply the inverse.
As far as I'm concerned windows got it _right_ and linux got it... 'linux'.
I like DLL's being self contained modules with tightly controlled
interfaces. And deadalnix lists important points.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20120411/7bfbef2e/attachment.html>


More information about the Digitalmars-d mailing list