[comp.sys.amiga.tech] C++

tron1@tronsbox.xei.com (HIM) (09/11/90)

 
  Hi there .

     I fully expect to get the standard "Why would you use THAT!" flames
     from anti-lattice and anti-C++ folks but here goes.

     I am about to begin work on a commercial programming project for
     the Amiga (I will be getting a A3000 to do it on , my A1000 will
     hook up with DNET and just play ray-tracer ;-) ).

     I own the Lattice C++ 1.0 compiler , and a full set of the
     Lattice 5.10 complers, I have done a LOT with the 5.10 and
     quite a bit with C++ (cfront 1 and 2.0) at Belle Labs... so much
     so that I really don't want to give up the adavantages of C++
     for this project.

     So , the dillema is... do I :

     1) Write it in C 5.1 , and have guarenteed OS 2.0 compatibility
        source debugger and all.
     
     2) Use the C++ Compiler and have the object work available to
        make life easier.

     SO .. there are some questions I would like to ask so I can evaluate :

     1) I have examined the output C from C++ , it makes very standard
        1.2 Style calls to the OS. The example programs that use
        windows/gadgets/draw graphics all run under 2.0 without
        problem.

        HOW compatible is 2.0 to 1.3 code ? I am not talking about 
        manipulating device drivers, or playing with the blitter here,
        just standard MENU/WINDOW/GADGET work assuming the C code plays
        "By the rules" ?

     2) Has anyone on the net attempted to work with the C++ compiler ?
        ESPECIALLY under 2.0 ??  I hvae seen posts about that it is
        buggy to the point that it is un-usable, but aside from the
        obvious problem that 1.0 is a BIG step back from 2.0
        (I WANT FSTREAMS) .. I havent seen any BUGS. But this is
        is only with the SIMPLE tests I have run. Any opinions
        (as opposed to flames) welcome.

     3) The Documentation is a bit sparse ( ;-) ) with the C++
        that Lattice provided. It IS consistent, so if someone has
        related the approach between the C++ objects and the
        C struct counterparts one example will unlock the text.

        (sheesh , you would think after doing X/OPENLOOK/MOTIF
         this would not be a problem for me)
     
        

       I guess that about does it , and now that I am looking over the list
I just put in it seems like I will have to go with C unless anyone says "Ive
done it it's fine" ... but every time I want to overload a functiothat voice
will say "you should have used ++" unless I at least ask!

========[ Xanadu Enterprises Inc. Amiga & Unix Software Development]========
=      "And in the darkened offices, the terminals shine like stars."      =
============= Ken Jamieson: uunet!tronsbox.xei.com!tron1  ==================
= NONE of the opinions represented here are endorsed by either             =
= Xanadu Enterpises or its clients, AT&T Bell Labs or others.              =
==== The Romantic Encounters BBS 201-759-8450(PEP) / 201-759-8568(2400) ==== 

 

 
 
     

hclausen@adspdk.CBMNET (Henrik Clausen) (09/13/90)

>In article <26ed022f-8f5comp.sys.amiga.tech@tronsbox.xei.com> tron1@tronsbox.xei.com (HIM) writes:
>
>     I fully expect to get the standard "Why would you use THAT!" flames
>     from anti-lattice and anti-C++ folks but here goes.

   OK, I'm using Lattice C, and used C++ as well, so I can comment (I hope)

>     I am about to begin work on a commercial programming project for
>     the Amiga (I will be getting a A3000 to do it on)

   This means compiler speed will be no problem, even with C++.

>     I own the Lattice C++ 1.0 compiler , and a full set of the
>     Lattice 5.10 complers, I have done a LOT with the 5.10 and
>     quite a bit with C++ (cfront 1 and 2.0) at Belle Labs... so much
>     so that I really don't want to give up the adavantages of C++
>     for this project.
>
>     So , the dillema is... do I :
>
>     1) Write it in C 5.1 , and have guarenteed OS 2.0 compatibility
>        source debugger and all.

   2.0 compatibility is not really a problem, it's pretty easy if you follow the
docs.

>     2) Use the C++ Compiler and have the object work available to
>        make life easier.
>
>     SO .. there are some questions I would like to ask so I can evaluate :
>
>     1) I have examined the output C from C++ , it makes very standard
>        1.2 Style calls to the OS. The example programs that use
>        windows/gadgets/draw graphics all run under 2.0 without
>        problem.
>
>        HOW compatible is 2.0 to 1.3 code ? I am not talking about 
>        manipulating device drivers, or playing with the blitter here,
>        just standard MENU/WINDOW/GADGET work assuming the C code plays
>        "By the rules" ?

   There's a lot of new stuff in 2.0. If you use this, you break. If not, it
works. So, using the 1.3 AutoDocs is a good start. But then, there's a lot of
neat stuff in 2.0 that you want to use. Version checking will make both available
for you - you don't do any 2.0 calls if running under 1.3. Easy to test on the
A3000, BTW, having both Kickstarts available.

>     2) Has anyone on the net attempted to work with the C++ compiler ?

   Yes. I scrapped it when I got down to real programs with more than one source
module. I had to compile every module except one with -x due to their 'smart'
tricks with IntuitionBase & GfxBase... In the end, I came across so much that
didn't work that I converted that project back to ordinary C.

> I have seen posts about that it is buggy to the point that it is un-usable,
> but I havent seen any BUGS. 

   The simple Gfx demo program produced a memory loss of 2.5K every time it was
run. The example shipped with the compiler! I couldn't find the source for the
loss in the example. It might be there though, been a while since I looked.

>        is only with the SIMPLE tests I have run. Any opinions
>        (as opposed to flames) welcome.

   I don't hope you consider the above a flame...

>       I guess that about does it , and now that I am looking over the list
>I just put in it seems like I will have to go with C unless anyone says "Ive
>done it it's fine" ... but every time I want to overload a function that voice
>will say "you should have used ++" unless I at least ask!

   I really liked C++ from the language point of view. Having only a 68000 CPU,
compile time was a problem. It was the slowness and buggyness of the
implementation that made me drop it.
   Not being able to CodePRobe the code also made a big contribution. I use
printf()'s a lot in preference of CPR, but compile time became prohibiting.

   SAS (formerly Lattice) seem to be working on a C++ compiler that is NOT a
preprocessor coupled to the (not too fast) C compiler. This might make a big
difference, but it's still a decent time into the future.
   I'll probably give it another chance by then, I'm quite attracted to C++.

>=      "And in the darkened offices, the terminals shine like stars."      =

   Hey, where's that from?

                                                      -Henrik

--
|            Henrik Clausen, Graffiti Data (Fido: 2:230/22.33)           |
|           ...{pyramid|rutgers}!cbmvax!cbmehq!adspdk!hclausen           |
\__"Do not accept the heart that is the slave to reason" - Qawwali trad__/

daveh@cbmvax.commodore.com (Dave Haynie) (09/14/90)

In article <26ed022f-8f5comp.sys.amiga.tech@tronsbox.xei.com> tron1@tronsbox.xei.com (HIM) writes:

>     1) I have examined the output C from C++ , it makes very standard
>        1.2 Style calls to the OS. The example programs that use
>        windows/gadgets/draw graphics all run under 2.0 without
>        problem.
>
>        HOW compatible is 2.0 to 1.3 code ? I am not talking about 
>        manipulating device drivers, or playing with the blitter here,
>        just standard MENU/WINDOW/GADGET work assuming the C code plays
>        "By the rules" ?

There's no problem with correctly written 1.3 software running under 2.0; as
long as you're not counting on private parts of structures looking the same,
or similar dirty tricks, you're in great shape.  For example, every program
I've written that doesn't depend on some 1.3 trick (eg, SetFont) or something
unsupported under 1.3 (eg, SetCPU V1.5, which ran into problems since it 
dealt with cache control issues that 2.0 solved differently) work just great.

>     2) Has anyone on the net attempted to work with the C++ compiler ?
>        ESPECIALLY under 2.0 ??  I hvae seen posts about that it is
>        buggy to the point that it is un-usable, but aside from the
>        obvious problem that 1.0 is a BIG step back from 2.0
>        (I WANT FSTREAMS) .. I havent seen any BUGS. But this is
>        is only with the SIMPLE tests I have run. Any opinions
>        (as opposed to flames) welcome.

I have only used it under 1.3.  While I didn't have any trouble with the 
resulting code, I did have some troubles with the C++ compiler.  It wanted
a heck of alot of stack (512K worked good) to avoid some crashes, and yet
it still had a problem with crashing on syntax errors.  The biggest problem
is the lack of a debugger -- once you're used to using a decent source level
debugger, you don't want to go back to "printfs" (or cout << for that matter).

>     3) The Documentation is a bit sparse ( ;-) ) with the C++
>        that Lattice provided. It IS consistent, so if someone has
>        related the approach between the C++ objects and the
>        C struct counterparts one example will unlock the text.

I was actually surprised they included a text on the C++ language; most
compilers only discuss the differences between their implementation of
the language, if any, and probably list all library functions.  I wouldn't
have minded a few details on some of the rather esoteric stuff (for 
example, a way to replace the C++ allocator with my own, globally) but 
overall, I didn't find the docs that bad.

>============= Ken Jamieson: uunet!tronsbox.xei.com!tron1  ==================

-- 
Dave Haynie Commodore-Amiga (Amiga 3000) "The Crew That Never Rests"
   {uunet|pyramid|rutgers}!cbmvax!daveh      PLINK: hazy     BIX: hazy
      Get that coffee outta my face, put a Margarita in its place!

cpca@iceman.jcu.oz (C Adams) (09/25/90)

> In article <26ed022f-8f5comp.sys.amiga.tech@tronsbox.xei.com> tron1@tronsbox.xei.com (HIM) writes:
> 
>         HOW compatible is 2.0 to 1.3 code ? I am not talking about 
>         manipulating device drivers, or playing with the blitter here,
>         just standard MENU/WINDOW/GADGET work assuming the C code plays
>         "By the rules" ?
> 

I have just had the chance to try out a program I am writing with some
other people under 1.3.  It is a graphic adventure with menues/windows/
gadgets of the magnetic scrolls/infocom type.  We were a bit worried
about whether it would run on 2.0, but it worked perfectly. 

Over 10,000 lines of code with graphics, sound etc. and we won't have
to change a thing.

The only difference I could tell was the top line of the requesters 
being inverted (the colours) when you click with the mouse.

********************************************************************
Colin Adams         Life's funny but I don't laugh
********************************************************************