Topic: C++ -> C


Author: chs@nando.net (Chip Salzenberg)
Date: 1995/07/27
Raw View
According to jason@cygnus.com (Jason Merrill):
>For the record, I believe that the GNU C++ compiler started out as such a
>conversion.  This may be taken as an argument either for or against James'
>thesis.  :)

Considering the amount of brute force work that G++ required before it
attained its current status -- and considering the distance it has to
go before it adequately supports e.g. templates and exceptions -- I'd
say that starting from scratch would have been a lot better.

OTOH, trouble was inevitable given the low quality of the initial G++
code (not the current stuff, which is quite good).
--
               Chip Salzenberg, aka <chs@nando.net>
     "And remember to worship at the railroad of your choice."
        -- Mike Nelson, MST3K: "The Amazing Transparent Man"





Author: jim.fleming@bytes.com (Jim Fleming)
Date: 1995/07/26
Raw View
In article <3ugmro$m2i@engnews2.Eng.Sun.COM>, clamage@Eng.Sun.COM says...
>
>In article 95Jul18162949@slsvhdt.lts.sel.alcatel.de,
kanze@lts.sel.alcatel.de (James Kanze
> US/ESC 60/3/141 #40763) writes:
>>
>>Just to set the record straight: all of the cases I'm aware of where a
>>company has tried to augment a C compiler to compile C++ have resulted
>>in very buggy compilers, very late to market, and with a noticeable
>>lack of features.
>
>I'm aware of a number of attempts to do such a conversion, undertaken
>by major companies with first-rate compiler developers, which have
>failed. They eventually dumped the project, and wrote a C++ compiler
>front end from scratch, or (more often) bought one from someone else.
>
>>On the other hand, it is fairly simple to inhibit the C++ features so
>>that a C++ compiler will compile C (and only C).  Whether this is
>>really useful or not, I don't know.
>
>Yes, it is useful. Several commercial C/C++ packages use the same
>compiler for both languages, inhibiting the C++ features when in C mode.
>This means only one compiler to maintain instead of two, and the
>resulting increase in reliability could be considered to offset any
>difference in compilation speed.
>
>---
>Steve Clamage, stephen.clamage@eng.sun.com
>
>
@@@@@@@@@@@@@@

Do these compilers produce the same output in "C mode" as they do
in "C/C++ mode" for a source file that contains only ANSI C...???

Assuming the answer is yes...if I then turn the "C/C++ mode" on,
does the compiler still produce the same output, assuming the source
has not changed...???

@@@@@@@@@@@@@@
--
Jim Fleming            /|\      Unir Corporation       Unir Technology, Inc.
jrf@tiger.bytes.com  /  | \     One Naperville Plaza   184 Shuman Blvd. #100
%Techno Cat I       /   |  \    Naperville, IL 60563   Naperville, IL 60563
East End, Tortola  |____|___\   1-708-505-5801         1-800-222-UNIR(8647)
British Virgin Islands__|______ 1-708-305-3277 (FAX)   1-708-305-0600
                 \__/-------\__/       http:199.3.34.13 telnet: port 5555
Smooth Sailing on Cruising C+@amarans  ftp: 199.3.34.12 <-----stargate----+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\____to the end of the OuterNet_|






Author: jason@cygnus.com (Jason Merrill)
Date: 1995/07/21
Raw View
>>>>> Steve Clamage <clamage@Eng.Sun.COM> writes:

> In article 95Jul18162949@slsvhdt.lts.sel.alcatel.de, kanze@lts.sel.alcatel.de (James Kanze US/ESC 60/3/141 #40763) writes:
>>
>> Just to set the record straight: all of the cases I'm aware of where a
>> company has tried to augment a C compiler to compile C++ have resulted
>> in very buggy compilers, very late to market, and with a noticeable
>> lack of features.

> I'm aware of a number of attempts to do such a conversion, undertaken
> by major companies with first-rate compiler developers, which have
> failed. They eventually dumped the project, and wrote a C++ compiler
> front end from scratch, or (more often) bought one from someone else.

For the record, I believe that the GNU C++ compiler started out as such a
conversion.  This may be taken as an argument either for or against James'
thesis.  :)

Jason





Author: clamage@Eng.Sun.COM (Steve Clamage)
Date: 1995/07/18
Raw View
In article 95Jul18162949@slsvhdt.lts.sel.alcatel.de, kanze@lts.sel.alcatel.de (James Kanze US/ESC 60/3/141 #40763) writes:
>
>Just to set the record straight: all of the cases I'm aware of where a
>company has tried to augment a C compiler to compile C++ have resulted
>in very buggy compilers, very late to market, and with a noticeable
>lack of features.

I'm aware of a number of attempts to do such a conversion, undertaken
by major companies with first-rate compiler developers, which have
failed. They eventually dumped the project, and wrote a C++ compiler
front end from scratch, or (more often) bought one from someone else.

>On the other hand, it is fairly simple to inhibit the C++ features so
>that a C++ compiler will compile C (and only C).  Whether this is
>really useful or not, I don't know.

Yes, it is useful. Several commercial C/C++ packages use the same
compiler for both languages, inhibiting the C++ features when in C mode.
This means only one compiler to maintain instead of two, and the
resulting increase in reliability could be considered to offset any
difference in compilation speed.

---
Steve Clamage, stephen.clamage@eng.sun.com







Author: kanze@lts.sel.alcatel.de (James Kanze US/ESC 60/3/141 #40763)
Date: 1995/07/18
Raw View
In article <3u8tba$7vm@info1.sdrc.com> scjones@thor.sdrc.com (Larry
Jones) writes:

|> Not as far as I know.  Since C++ is hot, there's a huge market for C++
|> compilers and it's reasonably easy to augment a C compiler to compile
|> C++ as well (certainly a lot easier than doing a completely different
|> language).  Given the relatively small amount of work required to reach
|> this market, any commercial compiler vendor would be foolish to not do
|> it.

Just to set the record straight: all of the cases I'm aware of where a
company has tried to augment a C compiler to compile C++ have resulted
in very buggy compilers, very late to market, and with a noticeable
lack of features.

Despite its superficial similarity, C++ *is* a different language than
C, and requires a considerably more complex front-end (and if done
correctly, a considerably more complex linker).

On the other hand, it is fairly simple to inhibit the C++ features so
that a C++ compiler will compile C (and only C).  Whether this is
really useful or not, I don't know.  Do you really want a C compiler
that is as big and as slow as your C++ compiler?
--
James Kanze         Tel.: (+33) 88 14 49 00        email: kanze@gabi-soft.fr
GABI Software, Sarl., 8 rue des Francs-Bourgeois, F-67000 Strasbourg, France
Conseils en informatique industrielle --
                              -- Beratung in industrieller Datenverarbeitung







Author: scjones@thor.sdrc.com (Larry Jones)
Date: 1995/07/15
Raw View
In article <3ts3u5$gf9@News1.mcs.net>, jim.fleming@bytes.com (Jim Fleming) writes:
> If enough of the features from C are added to C++, then doesn't the
> need for ANSI "C" go away?

(I'm sure you meant that the other way around -- pretty much all of the
features from C have been in C++ from day one.)  No, I don't think so.
I'm sure that some C++ people will disagree, but I think the general
concensus among the C Standards community is that C++ is the
experimental language where all sorts of interesting new features get
tried out.  The ones that work out (by that I mean they are widely used,
can be implemented reasonably efficiently, and don't unduely affect the
performance of programs that don't use them) can then be adopted into C.
That makes C kind of the well-defined and efficient subset of C++, which
is appropriate for a systems implementation language.

> Are there still any major compiler companies that focus their efforts
> on "just" ANSI C?

Not as far as I know.  Since C++ is hot, there's a huge market for C++
compilers and it's reasonably easy to augment a C compiler to compile
C++ as well (certainly a lot easier than doing a completely different
language).  Given the relatively small amount of work required to reach
this market, any commercial compiler vendor would be foolish to not do
it.

> Do you think that there will be a market for low-cost, solid, ANSI C
> compilers?

Are there any major compiler companies that sell *only* a C++ compiler?
I think that answers the question.

> When employment ads say, "Wanted - C++ Experience Required", what does
> that mean? Does that mean that the company is looking for OO expertise?

It usually means that the employer is buzz-word aware, so they probably
*are* looking for "OO experience", even though they probably don't know
what it means.  Since most of my C programs compile quite nicely with a
C++ compiler, that's probably good enough for most such companies.  (I'm
reminded of the situation 15 years ago when IBM first announced their SNA
network architecture that was supposed to do all the things for the
computing world that TCP/IP actually did later.  Only months later, long
before IBM had any actual products that actually implemented SNA,
companies were advertising for people with 3-5 years of SNA
implementation experience.)
----
Larry Jones, SDRC, 2000 Eastman Dr., Milford, OH  45150-2789  513-576-2070
larry.jones@sdrc.com
If I was being raised in a better environment, I wouldn't
do things like that. -- Calvin





Author: baynes@ukpsshp1.serigate.philips.nl (Stephen Baynes)
Date: 1995/07/17
Raw View
Jim Fleming (jim.fleming@bytes.com) wrote:
: Are there still any major compiler companies that focus their efforts
: on "just" ANSI C?

: Do you think that there will be a market for low-cost, solid, ANSI C
: compilers?

Yes

In the embeded systems world, size of code and data is too important.

The overhead needed for C++ programs is often too much.

--
Stephen Baynes                              baynes@mulsoc2.serigate.philips.nl
Philips Semiconductors Ltd
Southampton                                 My views are my own.
United Kingdom





Author: jim.fleming@bytes.com (Jim Fleming)
Date: 1995/07/17
Raw View
In article <3u8tba$7vm@info1.sdrc.com>, scjones@thor.sdrc.com says...
>
>In article <3ts3u5$gf9@News1.mcs.net>, jim.fleming@bytes.com (Jim Fleming)
writes:
>> If enough of the features from C are added to C++, then doesn't the
>> need for ANSI "C" go away?
>
>(I'm sure you meant that the other way around -- pretty much all of the
>features from C have been in C++ from day one.)  No, I don't think so.
>I'm sure that some C++ people will disagree, but I think the general
>concensus among the C Standards community is that C++ is the
>experimental language where all sorts of interesting new features get
>tried out.
@@@@@@@@@@@

I wonder how many managers (and owners) would feel comfortable knowing
that their projects are being built on an "experimental language"?

@@@@@@@@@@@
>The ones that work out (by that I mean they are widely used,
>can be implemented reasonably efficiently, and don't unduely affect the
>performance of programs that don't use them) can then be adopted into C.
@@@@@@@@@@@

This sounds like the approach used with INDY race cars. The claim is that
passenger autos benefit from the fun and games people have at the track.

C++ is experimental and for fun and games.
C remains as the real language for real systems programmers and only
the best of the fun and games makes it to C...

@@@@@@@@@@@
>That makes C kind of the well-defined and efficient subset of C++, which
>is appropriate for a systems implementation language.
>
@@@@@@@@@@@

C still has a place, and hopefully can maintain its own identity...

@@@@@@@@@@@
>> Are there still any major compiler companies that focus their efforts
>> on "just" ANSI C?
>
>Not as far as I know.  Since C++ is hot, there's a huge market for C++
>compilers and it's reasonably easy to augment a C compiler to compile
>C++ as well (certainly a lot easier than doing a completely different
>language).  Given the relatively small amount of work required to reach
>this market, any commercial compiler vendor would be foolish to not do
>it.
@@@@@

Yes, but some of the commercial vendors seem to be taking a lot of time
to support ALL of the ANSI C++ standards...

@@@@@
>
>> Do you think that there will be a market for low-cost, solid, ANSI C
>> compilers?
>
>Are there any major compiler companies that sell *only* a C++ compiler?
>I think that answers the question.
>
@@@@@

If your comments above come to pass, it sounds like the ++ can be dropped.
When people say C, they really mean C/C++...

In my view this would be a shame...

Maybe the current ANSI C needs to be renamed to preserve its heritage...
 It is clear that C++ will not be renamed...
  ...D would have been a good choice...for obvious reasons...

@@@@@
>> When employment ads say, "Wanted - C++ Experience Required", what does
>> that mean? Does that mean that the company is looking for OO expertise?
>
>It usually means that the employer is buzz-word aware, so they probably
>*are* looking for "OO experience", even though they probably don't know
>what it means.  Since most of my C programs compile quite nicely with a
>C++ compiler, that's probably good enough for most such companies.  (I'm
>reminded of the situation 15 years ago when IBM first announced their SNA
>network architecture that was supposed to do all the things for the
>computing world that TCP/IP actually did later.  Only months later, long
>before IBM had any actual products that actually implemented SNA,
>companies were advertising for people with 3-5 years of SNA
>implementation experience.)
>----
>Larry Jones, SDRC, 2000 Eastman Dr., Milford, OH  45150-2789  513-576-2070
@@@@@@@@@@@@

We have a very confused situation at the moment. C++ programmers claim to
be doing OO development when they have never used classes.

People who have tried to use C++ to do *serious* OO development have
switched to Smalltalk, Eiffel, etc. or designed their own language.
It is interesting to note the comments of the Java developers, with
regard to C++ (http://java.sun.com). Their observations are very similar
to the experiences of C+@ developers.

@@@@@@@@@@@@
--
Jim Fleming            /|\      Unir Corporation       Unir Technology, Inc.
jrf@tiger.bytes.com  /  | \     One Naperville Plaza   184 Shuman Blvd. #100
%Techno Cat I       /   |  \    Naperville, IL 60563   Naperville, IL 60563
East End, Tortola  |____|___\   1-708-505-5801         1-800-222-UNIR(8647)
British Virgin Islands__|______ 1-708-305-3277 (FAX)   1-708-305-0600
                 \__/-------\__/       http:199.3.34.13 telnet: port 5555
Smooth Sailing on Cruising C+@amarans  ftp: 199.3.34.12 <-----stargate----+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\____to the end of the OuterNet_|






Author: jim.fleming@bytes.com (Jim Fleming)
Date: 1995/07/10
Raw View
In article <3tp0mj$hdo@info1.sdrc.com>, scjones@thor.sdrc.com says...
>
>In article <3t710o$e1a@News1.mcs.net>, jim.fleming@bytes.com (Jim Fleming)
writes:
>> It looks like many of the people on the ANSI C and ANSI C++ committees
>> are the same. If (or when) the two languages converge, it is likely that
>> those people that are common to both efforts will have the most
influence.
>> You might want to look into the ANSI C work also to make sure that you
>> are part of the "inside activity" of that process.
>
>On the contrary, there is very little overlap.  Nor is there any desire,
>as far as I know, within either committee to merge the two languages.
>----
>Larry Jones, SDRC, 2000 Eastman Dr., Milford, OH  45150-2789  513-576-2070
>larry.jones@sdrc.com
>He just doesn't want to face up to the fact that I'll be
>the life of every party. -- Calvin
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

If enough of the features from C are added to C++, then doesn't the
need for ANSI "C" go away?

Are there still any major compiler companies that focus their efforts
on "just" ANSI C?

Do you think that there will be a market for low-cost, solid, ANSI C
compilers?

When employment ads say, "Wanted - C++ Experience Required", what does
that mean? Does that mean that the company is looking for OO expertise?

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
--
Jim Fleming            /|\      Unir Corporation       Unir Technology, Inc.
jrf@tiger.bytes.com  /  | \     One Naperville Plaza   184 Shuman Blvd. #100
%Techno Cat I       /   |  \    Naperville, IL 60563   Naperville, IL 60563
East End, Tortola  |____|___\   1-708-505-5801         1-800-222-UNIR(8647)
British Virgin Islands__|______ 1-708-305-3277 (FAX)   1-708-305-0600
                 \__/-------\__/       http:199.3.34.13 telnet: port 5555
Smooth Sailing on Cruising C+@amarans  ftp: 199.3.34.12 <-----stargate----+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\____to the end of the OuterNet_|






Author: rory@spock.retix.com (Rory Ward)
Date: 13 Nov 91 19:06:44 GMT
Raw View
Does anyone know of a set of programming practices, that allows C++
(more specifically, an OOD) to be implemented in C. Specifically areas
such as inheritance & virtual functions. I know we can get a C++
translator, but the resultant C is horrible. The code that we produce
has to be readable & portable. We could use ideas from a C++
translator to create our own set of practices, but I was wondering
whether there are a set lying around somewhere.
Tanx
--
--
rory-ward@retix.com




Author: JI8@psuvm.psu.edu (Dave Jeffery)
Date: 20 Nov 91 00:53:42 GMT
Raw View
  There is a company, NABJA Software, that has a package that supports
 full OOP (and thus OOD) using ANSI or K&R C. The package does not use
 a preprocessor or modify the C language to provide support for multiple
 inheritance, message sending etc. The package is priced at only $49.00
 for full source code.

  NABJA Software can be reached at:

   NABJA Software
   P.O. Box 413
   Girard, PA 16417

   (814) 774-3699