Topic: What is a C++ program ?


Author: batman@rmv.spam.home.ro ("Timothy Madden")
Date: Fri, 29 Oct 2004 18:18:22 GMT
Raw View
"James Kuyper" <kuyper@wizard.net> wrote
> batman@rmv.spam.home.ro ("Timothy Madden") wrote
> > "James Kuyper" <kuyper@wizard.net> wrote
> >> batman@rmv.spam.home.ro ("Timothy Madden") wrote i
> >> ..
> >>> Shouldn't the standard clearly define what a program is
> >>> and what an implementation is ?
> >>
> >> See section 3.5. Basically, a C++ program is a set of translation
> >> units, all linked together.
> >
> >     Translation units are defined starting from 'the text of a program'
>
> Well, yes. How is that a problem? Where would you start the
> definition?

The problem is with the definition of a program. In the way things are
now, you must first have the 'program' defined, and then you will also
have the 'source files' defined and in turn 'translation units'.
>
> ..
> > Windows programs have a WinMain or _tmain function instead
> > and I think one could write compliant Windows programs in C++
[...]
> > .dlls with DllMain are no different. Maybe main is defined in
> > some library (I find this to be legal). If it is so, is a .dll a program
?
>
> I'm not too familiar with programming for dlls. I'm under the
> impression that a dll can't be a complete program in itself, that it
> requires an actual program to make use of it. Correct me if I'm wrong
> about this.

I think that a main() function could be included in the library of an Win32
implementation and then, by the standard,  a .dll is a program.
The fact that the implementation also requires another program
(an executable) to execute the .dll is not relevant to the standard.

This would raise the issue of a program being included in another program
To give this idea a thought I would first have to finish reading the
standard
for the core language.

Timothy Madden


---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]





Author: kuyper@wizard.net (James Kuyper)
Date: Mon, 1 Nov 2004 02:52:22 GMT
Raw View
batman@rmv.spam.home.ro ("Timothy Madden") wrote in message news:<2uecgkF25j3t4U1@uni-berlin.de>...
> "James Kuyper" <kuyper@wizard.net> wrote
>
>> batman@rmv.spam.home.ro ("Timothy Madden") wrote
..
>>>    Translation units are defined starting from 'the text of a
program'
>>
>>
>> Well, yes. How is that a problem? Where would you start the
>> definition?
>
>
>
> The problem is with the definition of a program. In the way things are
> now, you must first have the 'program' defined, and then you will also
> have the 'source files' defined and in turn 'translation units'.

Well, I suppose you could do it in that order if you want. I don't see
why that particular order is a problem. Conceptually, I tend to start
with the source code files, which are merged together to form
translation units, which are translated and then linked together to
form a program. Is that a better order for you?

If you think there's a problem, you'll need to explain what it is more
detail.

..
>> I'm not too familiar with programming for dlls. I'm under the
>> impression that a dll can't be a complete program in itself, that
it
>> requires an actual program to make use of it. Correct me if I'm
wrong
>> about this.
>
>
>
> I think that a main() function could be included in the library of an Win32
> implementation and then, by the standard,  a .dll is a program.

Only if main() and everything recursively needed by main() are part of
the dll as well.

Would someone who knows more than either of us does about dll's
comment on whether or not they can contain a main() function that acts
as the actual starting point of a C program?

> The fact that the implementation also requires another program
> (an executable) to execute the .dll is not relevant to the standard.

If the behavior that is required by the standard for a program can't
happen without that executable, then it isn't a program without that
executable.

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]





Author: kuyper@wizard.net (James Kuyper)
Date: Mon, 1 Nov 2004 10:04:03 GMT
Raw View
batman@rmv.spam.home.ro ("Timothy Madden") wrote in message news:<2u90n7F27rj8aU1@uni-berlin.de>...
..
> It is the other way around. Translation units are defined starting
> from the definition of a program  ...

Section 3.5 defines a program in terms of translation units, and
defines translation units as containing 0 or more declaration
sequences. You can trace the grammar down, and it never loops back to
being defined in terms of programs.

> ... (except that the definition of a
> program currently misses the standard).

Do you mean "is currently missing from"? What about section 3.5?

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]





Author: batman@rmv.spam.home.ro ("Timothy Madden")
Date: Mon, 25 Oct 2004 20:27:13 GMT
Raw View
The standard only says:

"ill-formed program [defns.ill.formed]:
    input to a C++ implementation [...]"

"If a program contains no violations of the rules [..]
     an implementation shall [..] accept and correctly
     execute that program "

Translation units and source files are defined only in
terms of 'the text of a program' so they do not tell us
what the program itself is.

An implementation is something that:
    - has requirements states by the standard
    - shall include documentation
    - shall define 'implementation-defined behaviour'
    - shall issue diagnostic messages when required
    - translates the text of a C++ program
    - defines a 'corresponding instance' of the abstract
        machine defined by the standard
    - accepts and executes C++ programs

Shouldn't the standard clearly define what a program is
and what an implementation is ?

For example a .dll could be as well considered a program
or as a part of a program if you ask me.

Timothy Madden


---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]





Author: v.Abazarov@comAcast.net (Victor Bazarov)
Date: Mon, 25 Oct 2004 22:36:35 GMT
Raw View
Timothy Madden wrote:
> The standard only says:
>
> "ill-formed program [defns.ill.formed]:
>     input to a C++ implementation [...]"
>
> "If a program contains no violations of the rules [..]
>      an implementation shall [..] accept and correctly
>      execute that program "
>
> Translation units and source files are defined only in
> terms of 'the text of a program' so they do not tell us
> what the program itself is.
>
> An implementation is something that:
>     - has requirements states by the standard
>     - shall include documentation
>     - shall define 'implementation-defined behaviour'
>     - shall issue diagnostic messages when required
>     - translates the text of a C++ program
>     - defines a 'corresponding instance' of the abstract
>         machine defined by the standard
>     - accepts and executes C++ programs
>
> Shouldn't the standard clearly define what a program is
> and what an implementation is ?
>
> For example a .dll could be as well considered a program
> or as a part of a program if you ask me.

For a standard-compliant C++ implementation a C++ program is
a _declarations-seq_ (see Grammar, A.3)  So, essentially a program
is a sequence of declarations.  See more details in the A.6 and the
rest of the Annex A.

V

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]





Author: invalid@bigfoot.com (Bob Hairgrove)
Date: Tue, 26 Oct 2004 19:36:57 GMT
Raw View
On Mon, 25 Oct 2004 20:27:13 GMT, batman@rmv.spam.home.ro ("Timothy
Madden") wrote:

>The standard only says:
>
>"ill-formed program [defns.ill.formed]:
>    input to a C++ implementation [...]"
>
>"If a program contains no violations of the rules [..]
>     an implementation shall [..] accept and correctly
>     execute that program "
>
>Translation units and source files are defined only in
>terms of 'the text of a program' so they do not tell us
>what the program itself is.
>
>An implementation is something that:
>    - has requirements states by the standard
>    - shall include documentation
>    - shall define 'implementation-defined behaviour'
>    - shall issue diagnostic messages when required
>    - translates the text of a C++ program
>    - defines a 'corresponding instance' of the abstract
>        machine defined by the standard
>    - accepts and executes C++ programs
>
>Shouldn't the standard clearly define what a program is
>and what an implementation is ?
>
>For example a .dll could be as well considered a program
>or as a part of a program if you ask me.

Perhaps one could define a program as a collection (or set) of
"translation units" together with the necessary accompanying headers
and libraries. "Translation units" is yet another buzz word which
usually just means ".cpp files". As I see it, "program" is just
whatever the programmer feeds to the compiler to translate, be it a
complete application or only part of one.

"Implementation" is confusing to everyone reading the standard for the
first time (at least to me it was). When you see that word, you can
usually just plug in "compiler" for it. That's what it most often
means, but it also includes things like the STL and the CRT which
usually ship together with the compiler.

The more precise the terminology becomes, the harder it is to
understand in plain language. But this is normal and IMHO necessary
for a definitive document such as the standard is.

--
Bob Hairgrove
NoSpamPlease@Home.com

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]





Author: kuyper@wizard.net (James Kuyper)
Date: Wed, 27 Oct 2004 02:54:19 GMT
Raw View
batman@rmv.spam.home.ro ("Timothy Madden") wrote in message news:<2u3s9iF25qo3aU1@uni-berlin.de>...
..
> Shouldn't the standard clearly define what a program is
> and what an implementation is ?

See section 3.5. Basically, a C++ program is a set of translation
units, all linked together. In general, it must contain a main()
function, and through that linkage it must include one and only one
definition of everything recursively used by main(). There's lots of
complications and exceptions to that "one and only one" issue, and 3.5
goes into them in a lot more detail than is needed here.

> For example a .dll could be as well considered a program
> or as a part of a program if you ask me.

Unless your dll has a main(), it can't qualify as a program in itself,
though it could be part of a program.

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]





Author: batman@rmv.spam.home.ro ("Timothy Madden")
Date: Wed, 27 Oct 2004 18:42:32 GMT
Raw View
"James Kuyper" <kuyper@wizard.net> wrote in message
news:8b42afac.0410261833.62bd8cdd@posting.google.com...
> batman@rmv.spam.home.ro ("Timothy Madden") wrote in message
news:<2u3s9iF25qo3aU1@uni-berlin.de>...
> ..
> > Shouldn't the standard clearly define what a program is
> > and what an implementation is ?
>
> See section 3.5. Basically, a C++ program is a set of translation
> units, all linked together.
    Translation units are defined starting from 'the text of a program' ...

> In general, it must contain a main()
> function, and through that linkage it must include one and only one
> definition of everything recursively used by main(). There's lots of
> complications and exceptions to that "one and only one" issue, and 3.5
> goes into them in a lot more detail than is needed here.

Indeed, but at least thing are well defined in the One Definition Rule
(at least I understood the section 3.2 without much truoble).

> > For example a .dll could be as well considered a program
> > or as a part of a program if you ask me.
>
> Unless your dll has a main(), it can't qualify as a program in itself,
> though it could be part of a program.

Windows programs have a WinMain or _tmain function instead
and I think one could write compliant Windows programs in C++

.dlls with DllMain are no different. Maybe main is defined in
some library (I find this to be legal). If it is so, is a .dll a program ?

Timothy Madden


---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]





Author: kanze@gabi-soft.fr
Date: Wed, 27 Oct 2004 18:51:18 GMT
Raw View
kuyper@wizard.net (James Kuyper) wrote in message
news:<8b42afac.0410261833.62bd8cdd@posting.google.com>...
> batman@rmv.spam.home.ro ("Timothy Madden") wrote in message
> news:<2u3s9iF25qo3aU1@uni-berlin.de>...
> ..
> > Shouldn't the standard clearly define what a program is
> > and what an implementation is ?

> See section 3.5. Basically, a C++ program is a set of translation
> units, all linked together. In general, it must contain a main()
> function, and through that linkage it must include one and only one
> definition of everything recursively used by main(). There's lots of
> complications and exceptions to that "one and only one" issue, and 3.5
> goes into them in a lot more detail than is needed here.

I think a key issue here is that how you specify which translation units
are part of the program depends on the implementation.

> > For example a .dll could be as well considered a program
> > or as a part of a program if you ask me.

> Unless your dll has a main(), it can't qualify as a program in itself,
> though it could be part of a program.

If the implementation says so.  And if it is effectively linked in a
manner that is transparent to the program, as if the link had actually
occurred before the program started.

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

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]





Author: batman@rmv.spam.home.ro ("Timothy Madden")
Date: Thu, 28 Oct 2004 11:11:24 GMT
Raw View
"Victor Bazarov" <v.Abazarov@comAcast.net> wrote in message
news:_xdfd.6894$Ae.678@newsread1.dllstx09.us.to.verio.net...
> Timothy Madden wrote:
[...]
> > Shouldn't the standard clearly define what a program is
> > and what an implementation is ?
> >
> > For example a .dll could be as well considered a program
> > or as a part of a program if you ask me.
>
> For a standard-compliant C++ implementation a C++ program is
> a _declarations-seq_ (see Grammar, A.3)  So, essentially a program
> is a sequence of declarations.  See more details in the A.6 and the
> rest of the Annex A.
>
> V
   This is as regarding only the syntax and not every _declarations-seq_
   could be a program.

    Timothy Madden


---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]





Author: batman@rmv.spam.home.ro ("Timothy Madden")
Date: Thu, 28 Oct 2004 11:11:23 GMT
Raw View
"Bob Hairgrove" <invalid@bigfoot.com> wrote in message
news:la3sn0hdc95bie5ulvdu7gujm83lkc11dp@4ax.com...
> On Mon, 25 Oct 2004 20:27:13 GMT, batman@rmv.spam.home.ro ("Timothy
> Madden") wrote:
>
> >The standard only says:
> >
> >"ill-formed program [defns.ill.formed]:
> >    input to a C++ implementation [...]"
> >
> >"If a program contains no violations of the rules [..]
> >     an implementation shall [..] accept and correctly
> >     execute that program "
> >
> >Translation units and source files are defined only in
> >terms of 'the text of a program' so they do not tell us
> >what the program itself is.
> >
> >An implementation is something that:
> >    - has requirements states by the standard
> >    - shall include documentation
> >    - shall define 'implementation-defined behaviour'
> >    - shall issue diagnostic messages when required
> >    - translates the text of a C++ program
> >    - defines a 'corresponding instance' of the abstract
> >        machine defined by the standard
> >    - accepts and executes C++ programs
> >
> >Shouldn't the standard clearly define what a program is
> >and what an implementation is ?
> >
> >For example a .dll could be as well considered a program
> >or as a part of a program if you ask me.
>
> Perhaps one could define a program as a collection (or set) of
> "translation units" together with the necessary accompanying headers
> and libraries. "Translation units" is yet another buzz word which
> usually just means ".cpp files".

It is the other way around. Translation units are defined starting
from the definition of a program (except that the definition of a
program currently misses the standard).

>As I see it, "program" is just
> whatever the programmer feeds to the compiler to translate, be it a
> complete application or only part of one.

'Compiler' is not a term really used in the standard and the compiler
 takes as input source files, which are storage units for the text of a
program.

> "Implementation" is confusing to everyone reading the standard for the
> first time (at least to me it was). When you see that word, you can
> usually just plug in "compiler" for it. That's what it most often
> means, but it also includes things like the STL and the CRT which
> usually ship together with the compiler.

To me it wasn't so this point is ok as for my question, except that it
also misses the definition. The implementation is just a general concept
(not necessary confusing one) which includes the operating system
because an implementation 'executes a program' .
For example 'platform' is a general concept which includes
operating system, target machine, compiler (and language),
etc and that is not confusing to me.

> The more precise the terminology becomes, the harder it is to
> understand in plain language. But this is normal and IMHO necessary
> for a definitive document such as the standard is.
>
> --
> Bob Hairgrove
> NoSpamPlease@Home.com
>
> ---
> [ comp.std.c++ is moderated.  To submit articles, try just posting with ]
> [ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
> [              --- Please see the FAQ before posting. ---               ]
> [ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]
>


---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]





Author: kuyper@wizard.net (James Kuyper)
Date: Thu, 28 Oct 2004 16:13:10 GMT
Raw View
batman@rmv.spam.home.ro ("Timothy Madden") wrote in message news:<2u91j8F26gekfU1@uni-berlin.de>...
> "James Kuyper" <kuyper@wizard.net> wrote in message
> news:8b42afac.0410261833.62bd8cdd@posting.google.com...
>
>> batman@rmv.spam.home.ro ("Timothy Madden") wrote in message
>
>
> news:<2u3s9iF25qo3aU1@uni-berlin.de>...
>
>> ..
>>
>>> Shouldn't the standard clearly define what a program is
>>> and what an implementation is ?
>>
>>
>> See section 3.5. Basically, a C++ program is a set of translation
>> units, all linked together.
>
>
>     Translation units are defined starting from 'the text of a program'

Well, yes. How is that a problem? Where would you start the
definition?

..
> Windows programs have a WinMain or _tmain function instead
> and I think one could write compliant Windows programs in C++


a) That makes it a free-standing implementation of C++. The
requirement that main() be present only applies to hosted
implementations. I neglected to make that distinction.

b) Even if there is no main(), there must be some
implementation-defined starting routine. A complete program includes
the starting routine, and recursively everything it uses. It also
generally includes start-up code that calls main() or the the
implementation-defined alternative to main(). You need all of those
things before it qualifies as a program.

> .dlls with DllMain are no different. Maybe main is defined in
> some library (I find this to be legal). If it is so, is a .dll a program ?

I'm not too familiar with programming for dlls. I'm under the
impression that a dll can't be a complete program in itself, that it
requires an actual program to make use of it. Correct me if I'm wrong
about this.

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]





Author: kanze@gabi-soft.fr
Date: Thu, 28 Oct 2004 16:31:06 GMT
Raw View
batman@rmv.spam.home.ro ("Timothy Madden") wrote in message
news:<2u91j8F26gekfU1@uni-berlin.de>...
> "James Kuyper" <kuyper@wizard.net> wrote in message
> news:8b42afac.0410261833.62bd8cdd@posting.google.com...
> > batman@rmv.spam.home.ro ("Timothy Madden") wrote in message
>  news:<2u3s9iF25qo3aU1@uni-berlin.de>...
> > ..
> > > Shouldn't the standard clearly define what a program is
> > > and what an implementation is ?

> > See section 3.5. Basically, a C++ program is a set of translation
> > units, all linked together.
>     Translation units are defined starting from 'the text of a program' ...

> > In general, it must contain a main() function, and through that
> > linkage it must include one and only one definition of everything
> > recursively used by main(). There's lots of complications and
> > exceptions to that "one and only one" issue, and 3.5 goes into them
> > in a lot more detail than is needed here.

> Indeed, but at least thing are well defined in the One Definition Rule
> (at least I understood the section 3.2 without much truoble).

> > > For example a .dll could be as well considered a program or as a
> > > part of a program if you ask me.

> > Unless your dll has a main(), it can't qualify as a program in
> > itself, though it could be part of a program.

> Windows programs have a WinMain or _tmain function instead
> and I think one could write compliant Windows programs in C++

You think wrong.

In practice, I don't think one really writes 100% compliant programs in
any environment -- there's just too much necessary functionality
(e.g. GUI, sockets, threads, data base interfaces...) that isn't
specified in the standard.  So the modules which don't interface with
any of this are compliant, and the others aren't.  And of course, the
"program", taken as a whole, isn't compliant.

The important thing isn't being compliant -- it's being aware of what
depends on various extensions, and isolating it as much as possible, so
that if you ever do have to port...

> .dlls with DllMain are no different. Maybe main is defined in some
> library (I find this to be legal). If it is so, is a .dll a program ?

Formally, to be compliant, a program must contain one, and only one,
function main.  How you specify to the implementation which translation
units are part of the program is implementation defined.  In practice,
all implementations I know do have facilities for incorporating
translation units which are in a library.  Whether the translation unit
which contains main comes from a library or elsewhere is irrelevant with
regards to standards conformance.

(Note that DLL's introduce some additional twists with regards to
standards compliance.)

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

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]





Author: kuyper@wizard.net (James Kuyper)
Date: Thu, 28 Oct 2004 16:31:11 GMT
Raw View
invalid@bigfoot.com (Bob Hairgrove) wrote in message news:<la3sn0hdc95bie5ulvdu7gujm83lkc11dp@4ax.com>...
> On Mon, 25 Oct 2004 20:27:13 GMT, batman@rmv.spam.home.ro ("Timothy
> Madden") wrote:
>
>
>> The standard only says:
>>
>> "ill-formed program [defns.ill.formed]:
>>   input to a C++ implementation [...]"
>>
>> "If a program contains no violations of the rules [..]
>>    an implementation shall [..] accept and correctly
>>    execute that program "
>>
>> Translation units and source files are defined only in
>> terms of 'the text of a program' so they do not tell us
>> what the program itself is.
>>
>> An implementation is something that:
>>   - has requirements states by the standard
>>   - shall include documentation
>>   - shall define 'implementation-defined behaviour'
>>   - shall issue diagnostic messages when required
>>   - translates the text of a C++ program
>>   - defines a 'corresponding instance' of the abstract
>>       machine defined by the standard
>>   - accepts and executes C++ programs
>>
>> Shouldn't the standard clearly define what a program is
>> and what an implementation is ?
>>
>> For example a .dll could be as well considered a program
>> or as a part of a program if you ask me.
>
>
>
> Perhaps one could define a program as a collection (or set) of
> "translation units" together with the necessary accompanying headers
> and libraries. "Translation units" is yet another buzz word which
> usually just means ".cpp files".

Section 3.5 already address this, defining both "program" and
"translation unit" with much greater precision.

> whatever the programmer feeds to the compiler to translate, be it a
> complete application or only part of one.

If it's a compiler, it doesn't create programs, at least, not by
itself. Compilers translate translation units, typically creating one
object file for each translation unit. It's only the linker that
creates the complete program, by linking the translation units
together with the applicable libraries. Of course, most compilers I'm
familiar with automatically invoke the linker, if given the right
command line arguments, which tends to blur the distinction.

> "Implementation" is confusing to everyone reading the standard for the
> first time (at least to me it was). When you see that word, you can
> usually just plug in "compiler" for it. That's what it most often
> means, but it also includes things like the STL and the CRT which
> usually ship together with the compiler.
>
> The more precise the terminology becomes, the harder it is to
> understand in plain language. But this is normal and IMHO necessary
> for a definitive document such as the standard is.


The "implementation" also includes the linker.

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]