Boost Workshop at OOPSLA 2004

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Daveed Vandevoorde

    Re: export (WAS: Boost Workshop at OOPSLA 2004) (WILL BE: Save Andrei)

    "David B. Held" <dheld@codelogi cconsulting.com > wrote:[color=blue]
    > Daveed Vandevoorde wrote:[color=green]
    > > [...]
    > > I contend that, all other things being equal, export templates are more
    > > pleasant to work with than the equivalent inclusion templates. That by
    > > itself is sufficient to cast doubt on your claim that the feature is "broken
    > > and useless."[/color]
    >
    > What are your comments on N1426, given that you and the rest of EDG are
    > thoroughly quoted as being against export?[/color]

    (Sorry for the delay in answering. I have been busy lately.)

    I'm not particularly happy about that paper. It makes it look
    like EDG supports its points of view, when in fact that isn't
    the case. (I agree neither with the technical aspects nor with
    the nontechnical arguments of the paper.)

    That said, EDG opposed export at its introduction (I wasn't at
    EDG at the time, and I was somewhat sympathetic toward export;
    obviously I wasn't a compiler writer at all ;-). If I remember
    correctly, EDG's main arguments at the time were that the export
    proposal was too poorly understood and almost certainly very
    hard to implement.

    Daveed

    [ See http://www.gotw.ca/resources/clcm.htm for info about ]
    [ comp.lang.c++.m oderated. First time posters: Do this! ]

    Comment

    • kanze@gabi-soft.fr

      Re: Is export &quot;useles s and broken&quot;?

      Francis Glassborow <francis@robint on.demon.co.uk> wrote in message
      news:<IHjtv$SYr FOBFw+d@robinto n.demon.co.uk>. ..[color=blue]
      > In article <d6652001.04090 20233.fca3506@p osting.google.c om>,
      > kanze@gabi-soft.fr writes[color=green]
      > >Because make sees the dozen or so object files as being dependent on
      > >the template header file. If modifying the implementation of the
      > >template updates the timestamp of the header, make will recompile all
      > >of these files. In the case of export, the modification is in an
      > >implementati on file, the "dependency " is handled by the pre-linker,
      > >which knows enough to only compile one of the source files which
      > >triggered the instantiation, and not all of them.[/color][/color]
      [color=blue]
      > True, but only relevant if the header file with the template in it is
      > not yet stable. I doubt that this is true for many uses of templates
      > in large scale applications.[/color]

      It's obviously not true -- in a large scale application, you avoid
      templates other than very simple or very standard things (like
      std::vector), because you can't afford the dependencies.

      But that's circular reasoning: we don't fix the problem, because the
      case in question doesn't occur in real code, and the reason it doesn't
      occur in real code is because the problem isn't fixed.

      I don't know how relevant templates at the application level will be in
      the future. Today, they aren't used, because of the dependencies they
      introduce. And we do get by without them. However, in an earlier time,
      we got by without templates at all, and when I see some of the work of
      Andrei and others, I see things which might be relevant in application
      level code, if not now, then in the future.

      FWIW: I actually had the problem once. It turned out that one of the
      "stable" functions was a real performance bottleneck, and had to be
      tuned. Tuned, by experimenting with different variations, and running
      the results through the profiler. The actual function was called from
      exactly one module in the program, but the template was used in about
      20. And each time I modified the template, make recompiled all 20
      modules. I'll admit that it is an extreme case, but it did actually
      occur.

      --
      James Kanze GABI Software http://www.gabi-soft.fr
      Conseils en informatique orientée objet/
      Beratung in objektorientier ter Datenverarbeitu ng
      9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34

      [ See http://www.gotw.ca/resources/clcm.htm for info about ]
      [ comp.lang.c++.m oderated. First time posters: Do this! ]

      Comment

      • David Abrahams

        Re: export

        "Pavel Vozenilek" <pavel_vozenile k@yahoo.co.uk> writes:
        [color=blue]
        > "David Abrahams" wrote:
        >[color=green]
        > > Compilers that require fewer workarounds
        > > get ported [to Boost] much more quickly.
        > >[/color]
        > Its more function of compiler popularity than its quality.
        > /Pavel[/color]

        True. That said, for some compilers there are practically no
        workarounds. Porting to those goes very quickly ;-)

        --
        Dave Abrahams
        Boost Consulting


        [ See http://www.gotw.ca/resources/clcm.htm for info about ]
        [ comp.lang.c++.m oderated. First time posters: Do this! ]

        Comment

        • Gabriel Dos Reis

          Re: export (WAS: Boost Workshop at OOPSLA 2004) (WILL BE: Save Andrei)

          google@vandevoo rde.com (Daveed Vandevoorde) writes:

          [...]

          | (Note that two-phase name lookup predates export by quite
          | a bit. ADL was the result of a generalization for the
          | sake of export, and that affected the details of two-phase
          | name lookup when export was added to the language. However,
          | the gist of two-phase name lookup was already described in
          | D&E back in 1994.)

          Thanks for hammering this point again. There have been some myths
          about two-phase name lookup as a consequence of "export", even from
          some "old timer" C++ experts. I would complement your answer by
          providing a link to one of the first, publically available mailings,
          that was already discussing two-phase name lookup:



          That paper has the date "November 1992" and states

          Most of the background of this paper is derived from a lengthy
          discussion by the authors in May 1992, and subsequent electronic
          communication which discussed and reworked the original summary of
          that meeting.

          --
          Gabriel Dos Reis
          gdr@integrable-solutions.net

          [ See http://www.gotw.ca/resources/clcm.htm for info about ]
          [ comp.lang.c++.m oderated. First time posters: Do this! ]

          Comment

          • Hyman Rosen

            Re: Is export &quot;useles s and broken&quot;?

            kanze@gabi-soft.fr wrote:[color=blue]
            > I don't know how relevant templates at the application level will be in
            > the future. Today, they aren't used, because of the dependencies they
            > introduce.[/color]

            That's a pretty categorical claim. I know that it's your experience,
            but I doubt that it's universal.

            [ See http://www.gotw.ca/resources/clcm.htm for info about ]
            [ comp.lang.c++.m oderated. First time posters: Do this! ]

            Comment

            • kanze@gabi-soft.fr

              Re: export

              David Abrahams <dave@boost-consulting.com> wrote in message
              news:<uacw0rhm8 .fsf@boost-consulting.com> ...[color=blue]
              > "Pavel Vozenilek" <pavel_vozenile k@yahoo.co.uk> writes:[/color]
              [color=blue][color=green]
              > > "David Abrahams" wrote:[/color][/color]
              [color=blue][color=green][color=darkred]
              > > > Compilers that require fewer workarounds
              > > > get ported [to Boost] much more quickly.[/color][/color][/color]
              [color=blue][color=green]
              > > Its more function of compiler popularity than its quality.
              > > /Pavel[/color][/color]
              [color=blue]
              > True. That said, for some compilers there are practically no
              > workarounds. Porting to those goes very quickly ;-)[/color]

              I wonder if the ambiguity was intentional:-). Did you mean that there
              are compilers for which practically no workarounds are needed? (Porting
              to them should go pretty quickly.) Or did you mean those for which no
              practically workarounds exist? (Porting to them goes very quickly,
              too. Just a line "not supported" in the documentatino.)

              --
              James Kanze GABI Software http://www.gabi-soft.fr
              Conseils en informatique orientée objet/
              Beratung in objektorientier ter Datenverarbeitu ng
              9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34

              [ See http://www.gotw.ca/resources/clcm.htm for info about ]
              [ comp.lang.c++.m oderated. First time posters: Do this! ]

              Comment

              • David Abrahams

                Re: export

                kanze@gabi-soft.fr writes:
                [color=blue]
                > David Abrahams <dave@boost-consulting.com> wrote in message
                > news:<uacw0rhm8 .fsf@boost-consulting.com> ...[color=green]
                >> "Pavel Vozenilek" <pavel_vozenile k@yahoo.co.uk> writes:[/color]
                >[color=green][color=darkred]
                >> > "David Abrahams" wrote:[/color][/color]
                >[color=green][color=darkred]
                >> > > Compilers that require fewer workarounds
                >> > > get ported [to Boost] much more quickly.[/color][/color]
                >[color=green][color=darkred]
                >> > Its more function of compiler popularity than its quality.
                >> > /Pavel[/color][/color]
                >[color=green]
                >> True. That said, for some compilers there are practically no
                >> workarounds. Porting to those goes very quickly ;-)[/color]
                >
                > I wonder if the ambiguity was intentional:-). Did you mean that there
                > are compilers for which practically no workarounds are needed? (Porting
                > to them should go pretty quickly.)[/color]

                Yes.
                [color=blue]
                > Or did you mean those for which no practically workarounds exist?
                > (Porting to them goes very quickly, too. Just a line "not
                > supported" in the documentatino.)[/color]

                That would be true if it weren't for the fact that people are trying
                to port despite the difficulty. Incidentally, the efforts for HP have
                gone a lot better than those for Sun recently.

                --
                Dave Abrahams
                Boost Consulting


                [ See http://www.gotw.ca/resources/clcm.htm for info about ]
                [ comp.lang.c++.m oderated. First time posters: Do this! ]

                Comment

                • James Kanze

                  Re: export (WAS: Boost Workshop at OOPSLA 2004) (WILL BE: Save Andrei)

                  Gabriel Dos Reis <gdr@integrab le-solutions.net> writes:

                  |> google@vandevoo rde.com (Daveed Vandevoorde) writes:

                  |> [...]

                  |> | (Note that two-phase name lookup predates export by quite a bit.
                  |> | ADL was the result of a generalization for the sake of export, and
                  |> | that affected the details of two-phase name lookup when export was
                  |> | added to the language. However, the gist of two-phase name lookup
                  |> | was already described in D&E back in 1994.)

                  |> Thanks for hammering this point again. There have been some myths
                  |> about two-phase name lookup as a consequence of "export", even from
                  |> some "old timer" C++ experts.

                  I'm curious about this, because I've never heard the claim that
                  two-phased lookup was a consequence of "export". A lot of us missed its
                  initial introduction, for I really don't know what reasons.

                  Of course, the real problem is that most compilers don't, or until very
                  recently didn't implement either. And that while there was a good deal
                  of discussion concerning export, very little was said about the fact
                  that their name lookup wasn't conform.

                  |> I would complement your answer by providing a link to one of the
                  |> first, publically available mailings, that was already discussing
                  |> two-phase name lookup:

                  |> http://www.open-std.org/JTC1/SC22/WG...1992/N0209.pdf

                  |> That paper has the date "November 1992" and states

                  |> Most of the background of this paper is derived from a lengthy
                  |> discussion by the authors in May 1992, and subsequent electronic
                  |> communication which discussed and reworked the original summary
                  |> of that meeting.

                  No one not in the standards committee would have seen the paper, and
                  those not involved in the extensions group probably wouldn't have read
                  it. It's hardly a reference for the casual user.

                  Of course, I would expect anyone actually implementing a compiler to
                  have seen it. Which sort of makes one wonder -- in Noverber 1992, there
                  weren't that many implementations which actually supported templates.
                  That CFront didn't take this paper or the discussions which preceded it
                  into account is quite understandable, but what is the excuse of the
                  other implementors.

                  Because, of course, the biggest single reason we have such a problem
                  with two phase lookup is that it is different from what we are used to,
                  and what we have been using for the past eight or ten years.

                  --
                  James Kanze
                  Conseils en informatique orientée objet/
                  Beratung in objektorientier ter Datenverarbeitu ng
                  9 place Sémard, 78210 St.-Cyr-l'École, France +33 (0)1 30 23 00 34

                  [ See http://www.gotw.ca/resources/clcm.htm for info about ]
                  [ comp.lang.c++.m oderated. First time posters: Do this! ]

                  Comment

                  • James Kanze

                    Re: Is export &quot;useles s and broken&quot;?

                    Hyman Rosen <hyrosen@mail.c om> writes:

                    |> kanze@gabi-soft.fr wrote:
                    |> > I don't know how relevant templates at the application level will
                    |> > be in the future. Today, they aren't used, because of the
                    |> > dependencies they introduce.

                    |> That's a pretty categorical claim. I know that it's your experience,
                    |> but I doubt that it's universal.

                    And like most categorical claims, it is a blatant simplification. Like
                    everything else, the real question is one of a price/benefits trade-off.
                    The problem is that with current template implementations , the price
                    rapidly becomes very high, as soon as the code is non-trivial.

                    Consider two extreme cases. You're implementing Microsoft Office --
                    probably a couple of million lines of code. Do you really think
                    something like:

                    int
                    main()
                    {
                    Application< wchar_t > app ;
                    app.run() ;
                    }

                    would be doable, with everything else a template on the character type?
                    At the other extreme, I've a class which could have been put at the
                    application level. The only template involved is the constructor, and
                    all it does is use the two iterators to initialize a local std::vector.
                    I'd be hard put to say that something like that can't be used.

                    Somewhere between the two cases is a cut-off. My experience would
                    suggest that it is very low, quite close to the second case. For
                    several reasons, in fact, but at least partitially because of the
                    dependencies that using templates imposes. Such dependencies ARE a
                    reason for avoiding unnecessary templates. Not the only reason, but in
                    many cases, an important one.

                    --
                    James Kanze
                    Conseils en informatique orientée objet/
                    Beratung in objektorientier ter Datenverarbeitu ng
                    9 place Sémard, 78210 St.-Cyr-l'École, France +33 (0)1 30 23 00 34

                    [ See http://www.gotw.ca/resources/clcm.htm for info about ]
                    [ comp.lang.c++.m oderated. First time posters: Do this! ]

                    Comment

                    • kanze@gabi-soft.fr

                      Re: export

                      David Abrahams <dave@boost-consulting.com> wrote in message
                      news:<usm9q9lm1 .fsf@boost-consulting.com> ...
                      [color=blue]
                      > kanze@gabi-soft.fr writes:[/color]
                      [color=blue][color=green]
                      > > Or did you mean those for which no practically workarounds exist?
                      > > (Porting to them goes very quickly, too. Just a line "not
                      > > supported" in the documentatino.)[/color][/color]
                      [color=blue]
                      > That would be true if it weren't for the fact that people are trying
                      > to port despite the difficulty.[/color]

                      I would have imagined that once it was known that the current version of
                      the compiler didn't work, the efforts would be dropped. Basically: new
                      version of Boost: no effort, new version of compiler: a lot of effort.

                      At some point, there's no point in butting your head against a stone
                      wall. The wall usually wins.
                      [color=blue]
                      > Incidentally, the efforts for HP have gone a lot better than those for
                      > Sun recently.[/color]

                      That stands to reason. As you might guess, the most important compiler
                      for my right now is Sun CC.

                      --
                      James Kanze GABI Software http://www.gabi-soft.fr
                      Conseils en informatique orientée objet/
                      Beratung in objektorientier ter Datenverarbeitu ng
                      9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34

                      [ See http://www.gotw.ca/resources/clcm.htm for info about ]
                      [ comp.lang.c++.m oderated. First time posters: Do this! ]

                      Comment

                      • David Abrahams

                        Re: export

                        kanze@gabi-soft.fr writes:
                        [color=blue]
                        > David Abrahams <dave@boost-consulting.com> wrote in message
                        > news:<usm9q9lm1 .fsf@boost-consulting.com> ...
                        >[color=green]
                        >> kanze@gabi-soft.fr writes:[/color]
                        >[color=green][color=darkred]
                        >> > Or did you mean those for which no practically workarounds exist?
                        >> > (Porting to them goes very quickly, too. Just a line "not
                        >> > supported" in the documentatino.)[/color][/color]
                        >[color=green]
                        >> That would be true if it weren't for the fact that people are trying
                        >> to port despite the difficulty.[/color]
                        >
                        > I would have imagined that once it was known that the current version of
                        > the compiler didn't work, the efforts would be dropped. Basically: new
                        > version of Boost: no effort, new version of compiler: a lot of effort.[/color]

                        Every so often, some Sun^H^H^Hpoor user comes along who really wants a
                        particular library, so they start hacking at the library hard and
                        sometimes they even come up with the neccessary workarounds. There's
                        never any effort unless some volunteer cares about the
                        platform/compiler.
                        [color=blue]
                        > At some point, there's no point in butting your head against a stone
                        > wall. The wall usually wins.[/color]

                        Doesn't stop ambitious people from trying, I guess.
                        [color=blue][color=green]
                        >> Incidentally, the efforts for HP have gone a lot better than those
                        >> for Sun recently.[/color]
                        >
                        > That stands to reason. As you might guess, the most important
                        > compiler for my right now is Sun CC.[/color]

                        Of course ;-)

                        --
                        Dave Abrahams
                        Boost Consulting


                        [ See http://www.gotw.ca/resources/clcm.htm for info about ]
                        [ comp.lang.c++.m oderated. First time posters: Do this! ]

                        Comment

                        Working...