The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: jrengdahl@safeaccess.com (Jonathan Engdahl)
Subject: [pups] lcc (was: GCC)
Date: Sun, 20 Jan 2002 21:22:14 -0500	[thread overview]
Message-ID: <005001c1a234$4b5befc0$48e11840@rcs.ra.rockwell.com> (raw)
In-Reply-To: <woNqxNB2FqS8EwcB@falstaf.demon.co.uk>

> >>   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





  parent reply	other threads:[~2002-01-21  2:22 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2002-01-20 15:24 norman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='005001c1a234$4b5befc0$48e11840@rcs.ra.rockwell.com' \
    --to=jrengdahl@safeaccess.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).