The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: Dibyendu Majumdar <mobile@majumdar.org.uk>
To: Paul Ruizendaal <pnr@planet.nl>
Cc: TUHS main list <tuhs@minnie.tuhs.org>
Subject: Re: [TUHS] Looking for final C compiler by Dennis Ritchie
Date: Sun, 22 Jul 2018 21:49:04 +0100	[thread overview]
Message-ID: <CACXZuxeJ3igMtfbLs1iUPMLhomQUG0dEjpaHHmV0L7hF0bvo4g@mail.gmail.com> (raw)
In-Reply-To: <8ECDA62D-1B54-4391-A226-D3E9ABEE4C07@planet.nl>

Hi Paul,

On 20 July 2018 at 11:04, Paul Ruizendaal <pnr@planet.nl> wrote:
>> I will try to port the C compiler to amd64 - while preserving as much of
>> the original code as I can. But not sure if this is even feasible.
>
> If that is your goal, you might want to start with the version included with 2.11BSD. It is essentially the same as the version from V7, but with 15 more years of bug fixes. I used that source to port V6 Unix to the TI990 architecture back in 2014/2015 and the good thing about it is that it still compiles with a modern gcc.

I found similarities between the 2.11BSD and 10th edition sources -
presumably 2.11BSD was based on (or incorporated) changes in the 10th
edition?

BTW did you publish your work?

> For your project, I think you would be able to use the first pass ‘c0’ almost unchanged.

I have been able to get c0 working. I had to work around the use of
sbrk() as this is not supported on Windows. I also changed the output
to text format - mainly so that I can see what is being generated.

> The second pass ‘c1’ would need major restructuring. It mainly builds a tree for each expression and then performs various transformations, many of which are PDP11 specific (but also portable ones, like handling of constant expressions). It then covers the tree with code fragments selected from a library. This library (‘optable') would need a full rewrite as well.

This part will be more difficult I suspect - but I will only start on
this after I have converted c0 to output 64-bit compliant intermediate
code.

It seems that Dennis Ritchie wrote a paper 'A Tour through the Unix C
Compiler' which is quite useful in understanding the compiler. I have
converted the doc to Markdown format as well which makes it easier to
read.

Thanks and Regards
Dibyendu

  parent reply	other threads:[~2018-07-22 20:49 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-20 10:04 Paul Ruizendaal
2018-07-20 19:57 ` Dibyendu Majumdar
2018-07-22 20:49 ` Dibyendu Majumdar [this message]
2018-07-23  9:24   ` Paul Ruizendaal
2018-07-23 10:28     ` arnold
2018-07-23 19:35       ` Dibyendu Majumdar
2018-07-24  6:37         ` arnold
2018-07-23 15:12   ` Clem Cole
2018-07-23 15:55     ` Larry McVoy
2018-07-23 19:29     ` Dibyendu Majumdar
2018-07-23 20:12     ` Bakul Shah
2018-07-23 20:48       ` Dibyendu Majumdar
  -- strict thread matches above, loose matches on Subject: below --
2018-07-18 21:37 Dibyendu Majumdar
2018-07-19  5:41 ` arnold
2018-07-19 19:23   ` Dibyendu Majumdar
2018-07-20 22:04     ` Dibyendu Majumdar
2018-07-19 14:50 ` Clem Cole
2018-07-19 19:40   ` Dibyendu Majumdar

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=CACXZuxeJ3igMtfbLs1iUPMLhomQUG0dEjpaHHmV0L7hF0bvo4g@mail.gmail.com \
    --to=mobile@majumdar.org.uk \
    --cc=pnr@planet.nl \
    --cc=tuhs@minnie.tuhs.org \
    /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).