I am an avid C++ fan who is about to get an Atari 1040ST and a C
package. My question is: is there any way to get a C++ package for
the 1040? Alternately, is there any C source code for CC that I can
get my hands on?
Thanks in advance.
John Ogawa
UC San Diego
It would be relatively simple bring up C++ under Lattice C for the ST;
Oasys just has to be convinced that it is worth the effort to do so.
None of the other ST C compilers (especially Alcyon C which comes with the
developers kit) would be usable back-ends for C++; the backend compiler
the AT&T released C++ frontend REALLY!!! needs at least 32 significant
characters in names. To my knowledge, Lattice C (using the GST linker)
is the only ST C compiler that can support 32 significant characters in names.
dgc
I am afraid this is unlikely. All C++ compilers I am aware of
(i.e. AT&T's) are actually fancy preprocessors that spit out rather
wild looking C. If CC is to work on an atari, your ATARI C compiler
must (and i mean MUST) be able to cope with *ARBITRARILY* long
identifiers.
I am not aware of any C compiler for the atari ST that will suffice,
(my own Lattice C compiler nmormally uses only the first 8 characters,
and will in any event, use at most 32 characters of an identifier.
This is probably not enough for C++. )
M. Brinsmead @ Univewrsity of Calgary.
If your compiler is capable of handling 32 character variable names, you should
normally not have any problems with using C++. There may be isolated cases
where problems would occur, but the names that the C++ compiler generates are
usually unique in the first 32 characters. Of course, it would be nice if one
of the C vendors for the ST would provide a true flexname capability. It really
isn't very difficult to do!
Barry Locklear
AT&T Information Systems Labs
Denver, CO 80234
(303) 538-4954
ihnp4!drutx!druhi!lbl
BTW: I devised a method to do object-oriented programming in C.
Not fancy but simple, and you get inheritance and even late binding
of sorts with high efficiency (about 100 microSecs for a typical
invocation of a method). If anybody is interested let me know.
- Moshe Braner
Say we use only 7-character letters-only identifiers.
26^7 = 8 031 810 176.
Seeing as how any C++ preprocessor is unlikely to produce over 8 billion
different identifiers, is there a good reason why a little filter couldn't
be inserted between C++'s output and C's input to shrink the size of these
huge identifiers to a manageable size.
Sure, it's slow; we've got a 8 MHz 68000. Sure, it's a kludge; it works!
(I hope)
Camille
If it were important enough you could keep a table of the correspondences
between symbol names and then write a postprocessor to rewrite the correct
symbolic names into the a.out file; this shouldn't be more than a day's work.
-- David desJardins
Oops, I guess I stand corrected. Of course, I've always believed
that if something dosen't work for certain isolated cases, it simply
dosent work, however, I suppose that if it means we *CAN* have C++ on
an ST, this is something we could learn to live with. (Provided, of
course, that you don't mind not being able to count on a given (correct)
program compiling.) Where do I order my Cfront?
Filtering long identifiers into short (but not mnemonic) forms would
work, I guess. But since we also have a Megabyte, it is not reasonable
to limit identifiers to anything less than 255 chars! Come on, compiler
makers: it's 1986!
- Moshe Braner
If anyone is interested, note that the past few GNU Emacs distributions have
included a simple program that reads C source code and produces a file of
#define statements to map long identifiers into short ones. It also
includes a replacement C Preprocesor (cpp) in case the one you are
currently using doesn't handle arbitrarily long identifiers.