[comp.sys.amiga.programmer] Lattice C++

nfs1675@dsacg3.dsac.dla.mil ( Michael S Figg) (01/17/91)

I know that the Lattice C++ package hasn't got great reviews in the past,
but at the present sale price of $150 is it worth the money for a curious
programmer with no C++ experience, but modest C experience. What has been
said about possible SAS upgrades when they come up with their package?

---Mike


-- 
 --------       o       A herd of bagels      | Michael Figg  DSAC-FSD
 |      |  --  oo o o   escaping from a deli. | DLA Systems Automation Center
 |      |  -- ooo oo    Looking for Lox in    | Cols, Ohio mfigg@dsac.dla.mil
 --------      o o      all the wrong places  | CIS: 73777,360    

besst@unix.cis.pitt.edu (Brian E. Schwadron) (01/18/91)

In article <2875@dsacg3.dsac.dla.mil> nfs1675@dsacg3.dsac.dla.mil ( Michael S Figg) writes:
>
>I know that the Lattice C++ package hasn't got great reviews in the past,
>but at the present sale price of $150 is it worth the money for a curious
>programmer with no C++ experience, but modest C experience. What has been
>said about possible SAS upgrades when they come up with their package?
>
>---Mike
     I called SAS, and they said that they had not decided on their Lattice C++
SAS C++ upgrade plan yet, but that they would probably have one.
     Being that "curious programmer with no C++ experience, but modest C
experience," I bought the package.  I certainly hope that they upgrade it, but
if they don't, then I still have a cheap C++ compiler.
					Brian

xanthian@zorch.SF-Bay.ORG (Kent Paul Dolan) (01/18/91)

nfs1675@dsacg3.dsac.dla.mil ( Michael S Figg) writes:

> I know that the Lattice C++ package hasn't got great reviews in the
> past, but at the present sale price of $150 is it worth the money for
> a curious programmer with no C++ experience, but modest C experience.

I'd wait.  It is a port of the C++ 1.0 release, which is a long, long
way from current C++ 2.1, and you really wouldn't be learning enough
useful to do you good later.

In addition, it is only a 25% discount off the dealer price I paid when
the product first came out, which is hardly fair; at the far remove from
current technology this package enjoys, it should be sold to recover the
cost of materials, shipping and handling, probably well under $50.

And, it really isn't a good stand alone package; though C++ 1.0 is
supposed to be a completely upward compatible revision of C, and this
package nominally comes with the 4.0 C compiler, they left out so much
of the C stuff that you can't compile even crufty old rev. 3.6 C code
with it, much less start with that and build in C++ functionality.

On the other hand, Dave Haynie long ago reported doing some good work
with it, so gather other opinions.

> What has been said about possible SAS upgrades when they come up with
> their package?

No promises, another poster noted.

Kent, the man from xanth.
<xanthian@Zorch.SF-Bay.ORG> <xanthian@well.sf.ca.us>

pm0@springs.cis.ufl.edu (Patrick Martin) (01/23/91)

Here is a direct quote of what was on the box of my Lattic C++
I bought last week:

"This product is sold with limited technical support.  Intro to
 Object-Oriented Programming And C++ is no longer included
 published by Addison Wesley Publishing CO., Reading Ma."

If I could have held off my purchase of C++ I would have.  (Especially
in light of the current development of G++)

Pat

dave@cs.arizona.edu (Dave P. Schaumann) (01/23/91)

In article <26429@uflorida.cis.ufl.EDU> pm0@springs.cis.ufl.edu (Patrick Martin) writes:
> [...]
>If I could have held off my purchase of C++ I would have.  (Especially
>in light of the current development of G++)
>
>Pat


This is the second post I've seen mentioning _G_++.  At first, I thought it
was just a weird typo.  So what is G++?  Some sort of C++ dialect/offshoot,
or just some marketdroid's idea of a clever name?

Or is it just a weird typo (that spreads... ;-)?

Dave Schaumann		|  And then -- what then?  Then, future...
dave@cs.arizona.edu	|  		-Weather Report

pm0@springs.cis.ufl.edu (Patrick Martin) (01/24/91)

In article <718@caslon.cs.arizona.edu> dave@cs.arizona.edu (Dave P. Schaumann) writes:
>This is the second post I've seen mentioning _G_++.  At first, I thought it
>was just a weird typo.  So what is G++?  Some sort of C++ dialect/offshoot,
>or just some marketdroid's idea of a clever name?
>
>Or is it just a weird typo (that spreads... ;-)?

G++ is the GNU (GNU's Not Unix) version of C++.  It is geared to work well
with Emacs (Another of their efforts).  I am not sure how well it works
with the Gnu Emacs for the amiga but anyways, you don't have to have Emacs
to get it to work anyways.

G++ is a very reliable program on other systems and is currently under development
for the amiga (So I hear through the Net anyways).

I have had some problems with Lattice so far.  Maybe someone out there can be
of some assistance.  The following program did not perform like my C++ book
said it should.  This is VERY basic so maybe some veteran C++ owner can help
me out (Seeing I have a C++ program due next Mon. and would like to develop
with Lattice)

Here it is (Simplified but the basics are still here):

#include <stream.h>

void read() {cout << "read()\n";}
void sort() {cout << "sort()\n";}

int main()
{
   read();
   sort();
   return 0;
}

This is so simple yet when I run it, it does not print:
read()
sort()

In fact it does not print anything at all.  The program compiles fine.

Am I missing something here?

Thanks in Advance,

Pat Martin

massa@uni-paderborn.de (Michael Janich) (01/24/91)

dave@cs.arizona.edu (Dave P. Schaumann) writes:

>In article <26429@uflorida.cis.ufl.EDU> pm0@springs.cis.ufl.edu (Patrick Martin) writes:
>> [...]

>This is the second post I've seen mentioning _G_++.  At first, I thought it
>was just a weird typo.  So what is G++?  Some sort of C++ dialect/offshoot,
>or just some marketdroid's idea of a clever name?

G++ is the GNU C++ - a UNIX PD (I think) c++ compiler. It's NO frontend
to convert C++ to C - it's a real compiler.

I'm searching for it on amiga!
-- 


   Michael Janich, Uni Paderborn, United Germany

daveh@cbmvax.commodore.com (Dave Haynie) (01/25/91)

In article <1991Jan18.120415.22068@zorch.SF-Bay.ORG> xanthian@zorch.SF-Bay.ORG (Kent Paul Dolan) writes:
>nfs1675@dsacg3.dsac.dla.mil ( Michael S Figg) writes:

>I'd wait.  It is a port of the C++ 1.0 release, which is a long, long
>way from current C++ 2.1, and you really wouldn't be learning enough
>useful to do you good later.

Well, actually, it's C++ 1.1a, as I recall.  It is sufficient to get you
started on C++, but it does have a number of missing pieces when compared
to modern C++.

>And, it really isn't a good stand alone package; though C++ 1.0 is
>supposed to be a completely upward compatible revision of C, and this
>package nominally comes with the 4.0 C compiler, they left out so much
>of the C stuff that you can't compile even crufty old rev. 3.6 C code
>with it, much less start with that and build in C++ functionality.

According to Lattice, they didn't intend the C++ distribution to be C++ with
the revision 4.0 compiler, they intended it simply to be C++.  The fact that
they used the 4.0 compiler as a back end, and based their C++ 1.0 release on
AT&T's "cfront", was just an implementation detail.  They could very easily,
at any time, offer an upgrade which didn't use the C compiler as a back end.
So, no documentation on the 4.0 compiler, and none of the 4.0 extras that
would not be useful under C++.  

They did, however, include the full C library with the C++ program.  When it
first shipped, they hadn't considered the library a supported part of C++.
Based mainly on user feedback, I suppose, they did change their mind on this,
rather early in the life of the product, too, and shipped out a manual to all
registered C++ owners detailing the C function library stuff.

>On the other hand, Dave Haynie long ago reported doing some good work
>with it, so gather other opinions.

I did, though I haven't used it recently.  They have only themselves to blame.
I found the C++ distribution, initially, to have two annoying problems.  The
first was speed -- going through cpp, cfront, LC1, LC2, and BLINK to produce
code takes longer than you might like.  I suspect the real problem is the first
three phases -- each of these requires a lexical analysis of ASCII input, which
is often one of the most time consuming phases of any compiler.  Faster Amigas
and disks solved this problem for me, basically.  The next problem was the
compiler's tendency to crash on syntax errors.  Large stack (a meg or so)
helped, but didn't eliminate, this problem.  I suppose the typically sloppy
coding (from AT&T, not Tim's fault) of the originally UNIX based C code in 
cpp and cfront is more than likely the problem here, but it put a damper on
things.  

What finally got me to stop using it much, though, was neither of these.  When
Lattice released CodeProbe, I got spoiled.  It didn't read C++, and I found 
I could get much more done with C and source level debugging than with C++
and my older, more primitive debugging techniques.  I still write better code
in C++, and would pay to switch back if I can have C++ source level debugging
along with it.

>Kent, the man from xanth.


-- 
Dave Haynie Commodore-Amiga (Amiga 3000) "The Crew That Never Rests"
   {uunet|pyramid|rutgers}!cbmvax!daveh      PLINK: hazy     BIX: hazy
	"What works for me might work for you"	-Jimmy Buffett

jac@gandalf.llnl.gov (James A. Crotinger) (01/26/91)

massa@uni-paderborn.de (Michael Janich) writes:
> G++ is the GNU C++ - a UNIX PD (I think) c++ compiler. It's NO frontend
> to convert C++ to C - it's a real compiler.

  Two important points: First, the GNU software is *NOT* PD. PD implies
you can do whatever you want with the source and the GNU source imposes
very strict limits on what you can do with derivative works. Second, 
just because CFRONT translates C++ to C does not mean that it is not
a compiler. It is a compiler. It just uses C as it's output language
(just as G++ uses assembly language as its output language). That's not
to say that *native code* compilers don't have advantages--they do, they're
faster, for one, and they also may have fewer limitations on what they
can inline. 

  On the subject of Lattice C++, has anyone heard how they are progressing
with their native code compiler? Unfortunately I'm no longer on BIX, but
a few months ago John Toebes told me that Lattice was working on a native
code C++ compiler that would be CFRONT 2.1 compatible and that the projected
release would be first or second quarter of '91. 

>    Michael Janich, Uni Paderborn, United Germany

  Jim
--
-----------------------------------------------------------------------------
James A. Crotinger   Lawrence Livermore Nat'l Lab // The above views 
jac@gandalf.llnl.gov P.O. Box 808;  L-630     \\ // are mine and are not 
(415) 422-0259       Livermore CA  94550       \\/ necessarily those of LLNL.

kevin@loki.une.oz.au (Kevin Pollard) (05/05/91)

I've been looking {at Lattice C++ on an Amiga.

I've got the trusty
    main()
    {
        printf("\nHello world\n");
    }

working OK.

But how would I clear the screen first? In MS-DOS/TurboC  the 
    clrscr()
function would do it. Is there any such thing in Amiga/Lattice C++ ? 

-- 
Kevin Pollard			Internet:	kevin@loki.une.oz.au
 University of NewEngland
	Northern Rivers		Phone:		+61 (066) 203694
Lismore NSW Australia		"My brain hurts"

kevin@loki.une.oz.au (Kevin Pollard) (05/06/91)

I am trying to help someone with an Amiga and Lattice C++.

My background is Turbo C on MS-DOS machines.

Initially, I don't want to have to master C++ just to help him, so I want
to stick to standard C.

Can I access graphics in standard C using Lattice C++?

If so, what's the smallest program (this isn't a challenge) that will
set graphics mode and draw a line on the graphics screen, then wait
for a keystroke, then exit.

Any help appreciated - I don't know Amigas very well (probably obviously).
 
-- 
Kevin Pollard			Internet:	kevin@loki.une.oz.au
 University of NewEngland
	Northern Rivers		Phone:		+61 (066) 203694
Lismore NSW Australia		"My brain hurts"

karlm@epsilon.tih.no (Karl Martin Lund) (05/08/91)

In article <1467@loki.une.oz.au>, kevin@loki.une.oz.au (Kevin Pollard) writes:
|> I've been looking {at Lattice C++ on an Amiga.
|> 
|> I've got the trusty
|>     main()
|>     {
|>         printf("\nHello world\n");
|>     }
|> 
|> working OK.
|> 
|> But how would I clear the screen first? In MS-DOS/TurboC  the 
|>     clrscr()
|> function would do it. Is there any such thing in Amiga/Lattice C++ ? 
|> 
|> -- 
|> Kevin Pollard			Internet:	kevin@loki.une.oz.au
|>  University of NewEngland
|> 	Northern Rivers		Phone:		+61 (066) 203694
|> Lismore NSW Australia		"My brain hurts"



I don't know for sure, but printf ("\fHello world!\n"); might work. \f should be a formfeed if my memory is up to date.

Karl Martin

daveh@cbmvax.commodore.com (Dave Haynie) (05/09/91)

In article <1467@loki.une.oz.au> kevin@loki.une.oz.au (Kevin Pollard) writes:
>I've been looking {at Lattice C++ on an Amiga.

>But how would I clear the screen first? In MS-DOS/TurboC  the 
>    clrscr()
>function would do it. Is there any such thing in Amiga/Lattice C++ ? 

Clear what screen?  Your program doesn't own the WorkBench screen, so you
obviously can't clear it.  To clear the window your program is running within,
assuming it's a normal console window, try:

	cout << "\233H\233J";

or maybe

	cout << "\014";

The cout stream is usually buffered, so you need to either turn off buffering
or follow the clearing functions with a "\n" to flush the buffer.  I think
there's a stream method for either unbuffering or flushing the buffer without
a <CR>, check the streams.h file.

>Kevin Pollard			Internet:	kevin@loki.une.oz.au

-- 
Dave Haynie Commodore-Amiga (Amiga 3000) "The Crew That Never Rests"
   {uunet|pyramid|rutgers}!cbmvax!daveh      PLINK: hazy     BIX: hazy
      "That's me in the corner, that's me in the spotlight" -R.E.M.

steved@DIALix.oz.au (Steve Doherty) (05/09/91)

In article <1467@loki.une.oz.au> kevin@loki.une.oz.au (Kevin Pollard) writes:
>I've been looking {at Lattice C++ on an Amiga.
>
>I've got the trusty
>    main()
>    {
>        printf("\nHello world\n");
>    }
>
>working OK.
>

Try:

main()
{
   printf("\f\nHello World\n");
}

The '\f' is the formfeed character, it should clear the screen for you.

Worked for me.

Cheers,
Steve

dac@prolix.pub.uu.oz.au (Andrew Clayton) (05/09/91)

In article <1467@loki.une.oz.au>, Kevin Pollard writes:

> I've been looking {at Lattice C++ on an Amiga.
> 
> I've got the trusty
>     main()
>     {
>         printf("\nHello world\n");
>     }
> 
> working OK.
> 
> But how would I clear the screen first? In MS-DOS/TurboC  the 
>     clrscr()

This line should do it.

         printf("\012\nHello world\n");
                  ~~\
                     \Control-L. synchronicity? You be the judge.

Dac
--

jdickson@jato.jpl.nasa.gov (Jeff Dickson) (05/09/91)

In article <1991May08.150804.8834@edb.tih.no> karlm@epsilon.tih.no (Karl Martin Lund) writes:
>
>
>In article <1467@loki.une.oz.au>, kevin@loki.une.oz.au (Kevin Pollard) writes:
>|> I've been looking {at Lattice C++ on an Amiga.
>|> 
>|> I've got the trusty
>|>     main()
>|>     {
>|>         printf("\nHello world\n");
>|>     }
>|> 
>|> working OK.
>|> 
>|> But how would I clear the screen first? In MS-DOS/TurboC  the 
>|>     clrscr()
>|> function would do it. Is there any such thing in Amiga/Lattice C++ ? 
>|> 
>|> -- 
>|> Kevin Pollard			Internet:	kevin@loki.une.oz.au
>|>  University of NewEngland
>|> 	Northern Rivers		Phone:		+61 (066) 203694
>|> Lismore NSW Australia		"My brain hurts"
>
>
>
>I don't know for sure, but printf ("\fHello world!\n"); might work. \f should be a formfeed if my memory is up to date.
>
>Karl Martin

	How come no one ever follows up on a message such as this one with
RTFM? I already replied to this person and told him where the information
could be found, but NO.

-jeff

comeau@ditka.Chicago.COM (Greg Comeau) (05/10/91)

In article <1474@loki.une.oz.au> kevin@loki.une.oz.au (Kevin Pollard) writes:
>I am trying to help someone with an Amiga and Lattice C++.
>Initially, I don't want to have to master C++ just to help him, so I want
>to stick to standard C.

That's one valid approach to it.

>Can I access graphics in standard C using Lattice C++?

Some people on BIX said this was impossible a while back.  Personally,
I disbelieve such a response however with Lattice C++, based on the
1.x spec of C++, such a request involved some gymnastics depending
upon exactly what it is you're trying to do and how.

>If so, what's the smallest program (this isn't a challenge) that will
>set graphics mode and draw a line on the graphics screen, then wait
>for a keystroke, then exit.

I'm not versed enough in AmigaDOS specific, however what I can tell you
is that compiler supporting either the 2.0 or 2.1 spec of C++ have
something called 'extern "C"' syntax which allows you an interface to
C.  Under some, for instance, Comeau C++, we literally pick up your C
compilers include files.  Hence, the call in C++ would be *EXACTLY* the
same as it would be in C.

- Greg
-- 
	 Comeau Computing, 91-34 120th Street, Richmond Hill, NY, 11418
                          Producers of Comeau C++ 2.1
          Here:attmail.com!csanta!comeau / BIX:comeau / CIS:72331,3421
                     Voice:718-945-0009 / Fax:718-441-2310

eoo@let.rug.nl (Eize Oosting) (05/13/91)

In article <1467@loki.une.oz.au> kevin@loki.une.oz.au (Kevin Pollard) writes:
>I've been looking {at Lattice C++ on an Amiga.
>
>I've got the trusty
>    main()
>    {
>        printf("\nHello world\n");
>    }
>
>working OK.
>
>But how would I clear the screen first? In MS-DOS/TurboC  the 
>    clrscr()
>function would do it. Is there any such thing in Amiga/Lattice C++ ? 
>

What about the very very very simple char called '\f'. Try to printf() this
little beasty. 


  /\__________/\   /\___________________________________________________/\
 /              \ /                                                       \
|   Letteren-    |  Marvin Minsky once defined Artificial Intelligence as: |
|   Faculteit    |   '... the science of making machines do things that    |
| R.U. Groningen |   would require intelligence if done by men'.           |
| The Netherlands|                                                         |
|                |  Does this include adding a device to the Mountlist?    |
| eoo@let.rug.nl |                                           Eize Oosting  |
 \  __________  / \  ___________________________________________________  /
  \/          \/   \/                                                   \/

davidbro@microsoft.UUCP (Dave BROWN) (05/16/91)

In article <38576@ditka.Chicago.COM> comeau@csanta.attmail.com (Greg Comeau) writes:
>I'm not versed enough in AmigaDOS specific, however what I can tell you
>is that compiler supporting either the 2.0 or 2.1 spec of C++ have
>something called 'extern "C"' syntax which allows you an interface to
>C.  Under some, for instance, Comeau C++, we literally pick up your C
>compilers include files.  Hence, the call in C++ would be *EXACTLY* the
>same as it would be in C.

Just to pick nits, this is true unless the AmigaDOS or Intuition function
name is the same name as a method in a current class definition, in which case
the name would be prepended with :: .

No big deal, it's just that I ran into it the other day when I was creating
a List class that utilizes Exec's list handling functions.

>- Greg

dave

p.s. to greg:  I am the david brown you had been playing phone tag with
the other week.  The problem I was having was due to my forgetting to
set the stack to the correct size...


>-- 
>	 Comeau Computing, 91-34 120th Street, Richmond Hill, NY, 11418
>                          Producers of Comeau C++ 2.1
>          Here:attmail.com!csanta!comeau / BIX:comeau / CIS:72331,3421
>                     Voice:718-945-0009 / Fax:718-441-2310


-- 
Dave Brown                                       ...!uunet!microsoft!davidbro
...ni ssendriew eht tel eW
"the night doesn't like it...
 looks just like your face in the moon to me"