The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
* [pups] Re: GCC
@ 2002-01-18 22:13 norman
  2002-01-19  0:53 ` [pups] lcc (was: GCC) Greg Lehey
  0 siblings, 1 reply; 11+ messages in thread
From: norman @ 2002-01-18 22:13 UTC (permalink / raw)


Jonathan Engdahl:

  Consider lcc, the Princeton C compiler. It's much smaller than gcc, and ANSI
  compliant.

lcc's a good compiler; it has become cc in my own peculiar Ancient UNIX
environment.  But my environment is on VAXes, not PDP-11s; the lcc I use
probably cannot be compiled to a core compiler binary of less than about
180KB, of which 136KB is text, and that is without any real code generators.
(For those who know lcc: I am using a slightly-hacked-up lcc 3.6; the
180KB binary includes just the symbolic and null code generators, not
the enormous one I ended up with for the VAX.)

On the other hand, it is probably easier to split lcc into overlays or
multiple passes to make it fit on a PDP-11 than to do the same to gcc;
and lcc works fine as a cross-compiler.  And it's a good solid ANSI
compiler; enough so that it is a little annoying to use it on heritage
code (it grumbles, correctly, if a function returns no value and wasn't
declared void), and helpful or very painful (depending on your point of
view) when used on really old code that is sleazy about mixing types of
pointers in procedure arguments, or reusing one structure as part of another,
or the like.  I had an interesting time a few months ago getting an old
version of tbl to compile cleanly and produce correct results under lcc;
the program contained some ancient constructs that are truly remarkable
to look back on, especially for those of us who started out programming
that way and learned better the hard way ...

If I were going to work with PDP-11s, I would probably use lcc as a
cross-compiler myself, after writing or snitching a code generator of
course.

Norman Wilson



^ permalink raw reply	[flat|nested] 11+ messages in thread

* [pups] lcc (was: GCC)
  2002-01-18 22:13 [pups] Re: GCC norman
@ 2002-01-19  0:53 ` Greg Lehey
  2002-01-20 10:52   ` Robin Birch
  0 siblings, 1 reply; 11+ messages in thread
From: Greg Lehey @ 2002-01-19  0:53 UTC (permalink / raw)


On Friday, 18 January 2002 at 17:13:26 -0500, norman at nose.cs.utoronto.ca wrote:
> Jonathan Engdahl:
>
>   Consider lcc, the Princeton C compiler. It's much smaller than gcc, and ANSI
>   compliant.
>
> lcc's a good compiler; it has become cc in my own peculiar Ancient UNIX
> environment.

It also has the advantage that there's a good book about it describing
exactly how it works: "A retargetable C compiler: Design and
implementation" by Christopher Fraser and David Hanson
(Benjamin/Cummings, 1995, ISBN 0-8053-1670-1).

Greg
--
Finger grog at lemis.com for PGP public key
See complete headers for address and phone numbers



^ permalink raw reply	[flat|nested] 11+ messages in thread

* [pups] lcc (was: GCC)
  2002-01-19  0:53 ` [pups] lcc (was: GCC) Greg Lehey
@ 2002-01-20 10:52   ` Robin Birch
  2002-01-20 14:38     ` emanuel stiebler
                       ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Robin Birch @ 2002-01-20 10:52 UTC (permalink / raw)


In message <20020119112351.F60575 at wantadilla.lemis.com>, Greg Lehey 
<grog at lemis.com> writes
>On Friday, 18 January 2002 at 17:13:26 -0500, norman at nose.cs.utoronto.ca wrote:
>> Jonathan Engdahl:
>>
>>   Consider lcc, the Princeton C compiler. It's much smaller than gcc, 
>>and ANSI
>>   compliant.
>>
Where can it be found and is it legal to use it on the sorts of systems 
that we play with?.

regards

Robin
>> lcc's a good compiler; it has become cc in my own peculiar Ancient UNIX
>> environment.
>
>It also has the advantage that there's a good book about it describing
>exactly how it works: "A retargetable C compiler: Design and
>implementation" by Christopher Fraser and David Hanson
>(Benjamin/Cummings, 1995, ISBN 0-8053-1670-1).
>
>Greg
>--
>Finger grog at lemis.com for PGP public key
>See complete headers for address and phone numbers
>_______________________________________________
>PUPS mailing list
>PUPS at minnie.tuhs.org
>http://minnie.tuhs.org/mailman/listinfo/pups




^ permalink raw reply	[flat|nested] 11+ messages in thread

* [pups] lcc (was: GCC)
  2002-01-20 10:52   ` Robin Birch
@ 2002-01-20 14:38     ` emanuel stiebler
  2002-01-20 15:47       ` Bill Gunshannon
  2002-01-21  0:24     ` Greg Lehey
  2002-01-21  2:22     ` Jonathan Engdahl
  2 siblings, 1 reply; 11+ messages in thread
From: emanuel stiebler @ 2002-01-20 14:38 UTC (permalink / raw)


Robin Birch wrote:
> 
> >>
> >>   Consider lcc, the Princeton C compiler. It's much smaller than gcc,
> >>and ANSI
> >>   compliant.
> >>
> Where can it be found 

Please have a look at :

http://www.cs.princeton.edu/software/lcc/

> and is it legal to use it on the sorts of systems
> that we play with?.

The copyright is with Addison-Wesley. However, few companies bought the
right 
to use it. No idea about the price, and whom to ask at Addison-Wesley
...
 
cheers



^ permalink raw reply	[flat|nested] 11+ messages in thread

* [pups] lcc (was: GCC)
  2002-01-20 14:38     ` emanuel stiebler
@ 2002-01-20 15:47       ` Bill Gunshannon
  2002-01-20 16:07         ` emanuel stiebler
  0 siblings, 1 reply; 11+ messages in thread
From: Bill Gunshannon @ 2002-01-20 15:47 UTC (permalink / raw)


On Sun, 20 Jan 2002, emanuel stiebler wrote:

>
>
> Please have a look at :
>
> http://www.cs.princeton.edu/software/lcc/
>
> > and is it legal to use it on the sorts of systems
> > that we play with?.
>
> The copyright is with Addison-Wesley. However, few companies bought the
> right
> to use it. No idea about the price, and whom to ask at Addison-Wesley
> ...
>

And one other note.  I had the department secretary request a copy of
the book for me back before Christmas.  They said it would ship around
2 January.  When it hadn't shown up by the middle of the month I asked
her to check with our book rep again.  This time they told her it was
out of print and there was no idea when or even if it would be printed
again.  :-(

On another note, as long as we're talking compilers and PDP's, one of
profs here was cleaning his office and found documentation for WATBOL
on the PDP-11.  This reminded me that Waterloo had done a lot of things
for older systems like the PDP.  I wonder what the chances are someone
there could be found who would be willing/able to release this older
stuff under something like the BSD license so it could be used for
other projects??

bill

-- 
Bill Gunshannon          |  de-moc-ra-cy (di mok' ra see) n.  Three wolves
bill at cs.scranton.edu     |  and a sheep voting on what's for dinner.
University of Scranton   |
Scranton, Pennsylvania   |         #include <std.disclaimer.h>




^ permalink raw reply	[flat|nested] 11+ messages in thread

* [pups] lcc (was: GCC)
  2002-01-20 15:47       ` Bill Gunshannon
@ 2002-01-20 16:07         ` emanuel stiebler
  0 siblings, 0 replies; 11+ messages in thread
From: emanuel stiebler @ 2002-01-20 16:07 UTC (permalink / raw)


Bill Gunshannon wrote:
> 
> 
> And one other note.  I had the department secretary request a copy of
> the book for me back before Christmas.  They said it would ship around
> 2 January.  When it hadn't shown up by the middle of the month I asked
> her to check with our book rep again.  This time they told her it was
> out of print and there was no idea when or even if it would be printed
> again.  :-(

Strange ...

Most of the bookstores seem to have it in stock. Just click on the link
with the "bestbookbuys" 

And on a different note, the book is very good in explaining how it
could
work. But it is describing the version 3.6 of the compiler, so you have
to go through all the sources of 4.1 anyway, because of all changes . 
And you don't touch the book anymore ;-)

cheers & have fun



^ permalink raw reply	[flat|nested] 11+ messages in thread

* [pups] lcc (was: GCC)
  2002-01-20 10:52   ` Robin Birch
  2002-01-20 14:38     ` emanuel stiebler
@ 2002-01-21  0:24     ` Greg Lehey
  2002-05-10  4:43       ` Cyrille Lefevre
  2002-01-21  2:22     ` Jonathan Engdahl
  2 siblings, 1 reply; 11+ messages in thread
From: Greg Lehey @ 2002-01-21  0:24 UTC (permalink / raw)


On Sunday, 20 January 2002 at 10:52:38 +0000, Robin Birch wrote:
> In message <20020119112351.F60575 at wantadilla.lemis.com>, Greg Lehey <grog at lemis.com> writes
>> On Friday, 18 January 2002 at 17:13:26 -0500, norman at nose.cs.utoronto.ca> wrote:
>>> Jonathan Engdahl:
>>>
>>>  Consider lcc, the Princeton C compiler. It's much smaller than gcc,
>>> and ANSI
>>>  compliant.
>
> Where can it be found and is it legal to use it on the sorts of systems
> that we play with?.

It's in the FreeBSD Ports Collection as /usr/ports/lang/lcc, but it's
still version 3.6; if you update it for more recent versions, let me
know and I'll commit it.

Greg
--
Finger grog at lemis.com for PGP public key
See complete headers for address and phone numbers



^ permalink raw reply	[flat|nested] 11+ messages in thread

* [pups] lcc (was: GCC)
  2002-01-20 10:52   ` Robin Birch
  2002-01-20 14:38     ` emanuel stiebler
  2002-01-21  0:24     ` Greg Lehey
@ 2002-01-21  2:22     ` Jonathan Engdahl
  2 siblings, 0 replies; 11+ messages in thread
From: Jonathan Engdahl @ 2002-01-21  2:22 UTC (permalink / raw)


> >>   Consider lcc, the Princeton C compiler. It's much smaller
than gcc,
> >>and ANSI
> >>   compliant.
> >>
> Where can it be found and is it legal to use it on the sorts
of systems
> that we play with?.

About 10 years ago I used version 3 something and wrote a code
generator for a Transputer-like CPU on a chip that we did. I
wrote the author just to clarify, and he said that using their
compiler to generate code for our chip was fair use, as long as
I wasn't selling their code.

I never took a compiler course, but it wasn't that hard to
understand what was going on. I didn't have the book either. I
considered gcc first, but I never did figure it out.

In version three, the front end hands the code generator some
trees, and the code generator walks the trees and spits out
code. For a limited-stack machine similar to the Transputer, it
was easy, except I had to totally redo register allocation.

The front end for version 3 was very good. I recall I only had
to change two or three things in it.

My conclusion is that you have to be a compiler expert to write
a code generator for gcc. Any competent programmer could do it
for lcc.

I think the new version has a code generator generator.

Doing an lcc code generator for the PDP-11 is on my "someday"
list. One thing that you could to do to make it fit on the
PDP-11 is break it up into preprocessor, front-end, and code
generator programs.


--
Jonathan Engdahl                    Rockwell Automation
Principal Research Engineer         1 Allen-Bradley Drive
Advanced Technology                 Mayfield Heights, OH 44124
http://users.safeaccess.com/engdahl jrengdahl at safeaccess.com

"The things which are seen are temporary,
 but the things which are not seen are eternal."  II Cor. 4:18





^ permalink raw reply	[flat|nested] 11+ messages in thread

* [pups] lcc (was: GCC)
  2002-01-21  0:24     ` Greg Lehey
@ 2002-05-10  4:43       ` Cyrille Lefevre
  2002-05-10  5:08         ` Greg 'groggy' Lehey
  0 siblings, 1 reply; 11+ messages in thread
From: Cyrille Lefevre @ 2002-05-10  4:43 UTC (permalink / raw)


Greg Lehey wrote:
> It's in the FreeBSD Ports Collection as /usr/ports/lang/lcc, but it's
> still version 3.6; if you update it for more recent versions, let me
> know and I'll commit it.

your port tree isn't up-to-date anymore :)

$ cvs log ports/lang/lcc/Makefile
...
revision 1.15
date: 2002/04/12 19:29:14;  author: ade;  state: dead;  lines: +1 -1
Remove lang/lcc -- it's been broken for so long and there is no new
version.

Cyrille.
-- 
Cyrille Lefevre                 mailto:cyrille.lefevre at laposte.net



^ permalink raw reply	[flat|nested] 11+ messages in thread

* [pups] lcc (was: GCC)
  2002-05-10  4:43       ` Cyrille Lefevre
@ 2002-05-10  5:08         ` Greg 'groggy' Lehey
  0 siblings, 0 replies; 11+ messages in thread
From: Greg 'groggy' Lehey @ 2002-05-10  5:08 UTC (permalink / raw)


On Friday, 10 May 2002 at  6:43:51 +0200, Cyrille Lefevre wrote:
> Greg Lehey wrote:
>> It's in the FreeBSD Ports Collection as /usr/ports/lang/lcc, but it's
>> still version 3.6; if you update it for more recent versions, let me
>> know and I'll commit it.
>
> your port tree isn't up-to-date anymore :)

Not at all.

> $ cvs log ports/lang/lcc/Makefile
> ...
> revision 1.15
> date: 2002/04/12 19:29:14;  author: ade;  state: dead;  lines: +1 -1
> Remove lang/lcc -- it's been broken for so long and there is no new
> version.

Your MUA doesn't note the date of the message to which you were
replying.  It was 22 January, long before this commit.

Greg 
--
Finger grog at lemis.com for PGP public key
See complete headers for address and phone numbers



^ permalink raw reply	[flat|nested] 11+ messages in thread

* [pups] lcc (was: GCC)
@ 2002-01-20 15:24 norman
  0 siblings, 0 replies; 11+ messages in thread
From: norman @ 2002-01-20 15:24 UTC (permalink / raw)


lcc is not public-domain nor GPL, but it is freely available for `personal
research and instructional use,' and in general there is no restriction as
long as you don't redistribute it for profit or resell it.

Here's the official scoop, as inscribed in ./CPYRIGHT in the lcc 3.6
distribution.  It is possible that the terms have changed for newer
versions; I haven't been keeping track.

----
The authors of this software are Christopher W. Fraser and
David R. Hanson.

Copyright (c) 1991,1992,1993,1994,1995 by AT&T, Christopher W. Fraser,
and David R. Hanson. All Rights Reserved.

Permission to use, copy, modify, and distribute this software for any
purpose, subject to the provisions described below, without fee is
hereby granted, provided that this entire notice is included in all
copies of any software that is or includes a copy or modification of
this software and in all copies of the supporting documentation for
such software.

THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED
WARRANTY. IN PARTICULAR, NEITHER THE AUTHORS NOR AT&T MAKE ANY
REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.


lcc is not public-domain software, shareware, and it is not protected
by a `copyleft' agreement, like the code from the Free Software
Foundation.

lcc is available free for your personal research and instructional use
under the `fair use' provisions of the copyright law. You may, however,
redistribute lcc in whole or in part provided you acknowledge its
source and include this CPYRIGHT file. You may, for example, include
the distribution in a CDROM of free software, provided you charge only
for the media, or mirror the distribution files at your site.

You may not sell lcc or any product derived from it in which it is a
significant part of the value of the product. Using the lcc front end
to build a C syntax checker is an example of this kind of product.

You may use parts of lcc in products as long as you charge for only
those components that are entirely your own and you acknowledge the use
of lcc clearly in all product documentation and distribution media. You
must state clearly that your product uses or is based on parts of lcc
and that lcc is available free of charge. You must also request that
bug reports on your product be reported to you. Using the lcc front
end to build a C compiler for the Motorola 88000 chip and charging for
and distributing only the 88000 code generator is an example of this
kind of product.

Using parts of lcc in other products is more problematic. For example,
using parts of lcc in a C++ compiler could save substantial time and
effort and therefore contribute significantly to the profitability of
the product. This kind of use, or any use where others stand to make a
profit from what is primarily our work, requires a license agreement
with Addison-Wesley.  Per-copy and unlimited use licenses are
available; for more information, contact

	J. Carter Shanklin
	Addison Wesley Longman, Inc. 
	2725 Sand Hill Rd.
	Menlo Park, CA 94025
	415/854-0300 x2478 FAX: 415/614-2930 jcs at aw.com
-----
Chris Fraser / cwfraser at microsoft.com
David Hanson / drh at cs.princeton.edu
$Revision: 1.3 $ $Date: 1996/09/30 13:55:00 $



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2002-05-10  5:08 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-01-18 22:13 [pups] Re: GCC norman
2002-01-19  0:53 ` [pups] lcc (was: GCC) Greg Lehey
2002-01-20 10:52   ` Robin Birch
2002-01-20 14:38     ` emanuel stiebler
2002-01-20 15:47       ` Bill Gunshannon
2002-01-20 16:07         ` emanuel stiebler
2002-01-21  0:24     ` Greg Lehey
2002-05-10  4:43       ` Cyrille Lefevre
2002-05-10  5:08         ` Greg 'groggy' Lehey
2002-01-21  2:22     ` Jonathan Engdahl
2002-01-20 15:24 norman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).