[comp.lang.c++] Naive C++ vs. G++ question

beck@hermod.cs.cornell.edu (Micah Beck) (11/28/89)

I am about to embark on a software development project and need to
choose an implementation language.  I am interested in a language which
provides strong type checking, but also need to distribute my application
widely.  I think ANSI C would meet my needs, but I am interested in 
exploring OOP in C++.

Now comes the confusing part: choosing a compiler/translator.  I do not
understand the differences between C++ and G++ beyond the fact that the
former is a translator licensed by AT&T, the latter a PD compiler.
I would like to use the Oops library of objects, but it is labeled as
written for C++.  The licensing fee for C++ seems like an impediment to
wide distribution.

I am tempted to try and use G++ with the Oops classes and hope the result
will run under both C++ and G++ if I stick to simple language features.
Is there any hope that this will work?  Can experienced voices out there
provide any insight?  Should I just stick to ANSI C?

Micah Beck
Cornell Computer Science Dept.
beck@cs.cornell.edu

dan@oresoft.uu.net (Daniel Elbaum) (11/29/89)

In article <34623@cornell.UUCP> beck@cs.cornell.edu (Micah Beck) writes:
:
:Now comes the confusing part: choosing a compiler/translator.  I do not
:understand the differences between C++ and G++ beyond the fact that the
:former is a translator licensed by AT&T, the latter a PD compiler.
:I would like to use the Oops library of objects, but it is labeled as
:written for C++.  The licensing fee for C++ seems like an impediment to
:wide distribution.

:I am tempted to try and use G++ with the Oops classes and hope the result
:will run under both C++ and G++ if I stick to simple language features.
:Is there any hope that this will work?  Can experienced voices out there
:provide any insight?  Should I just stick to ANSI C?
:
:Micah Beck
:Cornell Computer Science Dept.
:beck@cs.cornell.edu


	C++ is a language.  AT&T sells a compiler called Cfront which
	reads C++ code and writes C code.  Other companies (including
	Oregon Software) sell compilers which read C++ code and write
	assembly or object code.  g++ is both a compiler and a language.
	The language resembles C++ very closely.

	You don't need a license to use the C++ language nor the OOPS
	library.  I imagine the g++ compiler will compile the OOPS
	library with little or no modification to the latter.

	If you stick strictly with C++ rules, you can use g++ to write
	code which works with a variety of compilers and machines.

-- 
The disbelievers say: "Lo!  This is a mere wizard."  -Quran, Surah X

({uunet,tektronix,reed,sun!nosun,osu-cis,psu-cs}!oresoft!(dan)@oresoft.uu.net)

psrc@pegasus.ATT.COM (Paul S. R. Chisholm) (11/29/89)

In article <34623@cornell.UUCP>, beck@hermod.cs.cornell.edu (Micah Beck) writes:
> [C++] is a translator licensed by AT&T, [G++ is] a PD compiler.

C++ is a programming language.  The AT&T C++ Language System, Release
2.0, is an implementation of that programming language.  The price
(except to universities) is *not* cheap!  It's sold only in source
form, largely to companies that in turn will produce end user
products.

G++ is a copyrighted (not public domain), pretty much freely
distributable implementation of a large subset (or maybe a superset of
a large subset) of C++.  (The "pretty much distributable" part refers
to the fact that if you pass along a binary copy, the copyright claims
you're obliged to make sure the recipient can also get source.)  There
are no restrictions on what you do with the output of G++, as long as
you use only the vanilla libraries.  If you use libG++, things get more
complicated.

> I would like to use the Oops library of objects, but it is labeled
> as written for C++.

Yup.  You'll need some implementation of the C++ language.  (It's
called the NIHlib nowadays, which I think is a nice pun.  It was
developed at the National Institutes for Health, and it helps fight the
dreaded "Not Invented Here" syndrome.)

> The licensing fee for C++ seems like an impediment to wide
> distribution.

The licensing *agreement* for the AT&T C++ Language System, Release
2.0, is an impediment to unlimited distribution.  Ditto for the
licenses for Zortech C++ or Sun's C++ compiler or Turbo C, or the
copyright on Dr. Stroustrup's book, or lots of other things in the
world.

> I am tempted to try and use G++ with the Oops classes and hope the result
> will run under both C++ and G++ if I stick to simple language features.
> Is there any hope that this will work?

Some.  Various attempts at sticking to a common subset have been
described on the net; keep listening.

> Should I just stick to ANSI C?

A friend of mine, Tony Hansen (author of THE C++ ANSWER BOOK) has been
marshalling arguments for our management that C++ is "a better C" than
ANSI C, just as ANSI is a better C than old K&R.  The data abstraction
facilities add more value; the object oriented features, still more.

> Micah Beck, beck@cs.cornell.edu

Paul S. R. Chisholm, AT&T Bell Laboratories
att!pegasus!psrc, psrc@pegasus.att.com, AT&T Mail !psrchisholm
I'm not speaking for the company, I'm just speaking my mind.