Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!mnetor!uunet!seismo!mcvax!ukc!eagle!icdoc!dcw
From: dcw@doc.ic.ac.uk (Duncan C White)
Newsgroups: comp.lang.modula2
Subject: Translating M2 -> C
Message-ID: <482@ivax.doc.ic.ac.uk>
Date: Thu, 16-Jul-87 12:31:05 EDT
Article-I.D.: ivax.482
Posted: Thu Jul 16 12:31:05 1987
Date-Received: Sat, 18-Jul-87 11:33:22 EDT
Sender: dcw@doc.ic.ac.uk
Reply-To: dcw@doc.ic.ac.uk (Duncan C White)
Distribution: comp
Organization: Dept. of Computing, Imperial College, London, UK.
Lines: 40


I have a proposal which I would like people to consider, and comment on:
I will outline it as a series of observations, leading to the proposal:

1).	every system worth talking about has a C compiler.

2).	often, the C compiler is heavily optimised.

3).	C is often referred to as a high-level assembler.
	What people omit is the important word 'portable'.

4).	Compilers conventionally produce assembler code.

5).	Why not bring all these together, and write a portable M2 compiler
	which generates C as it's intermediate code.  This would imply no
	tedious mucking around with new backends for different processors.
	This is the approach used by C++...

So, there is the proposal...  is the translation likely to be incredibly
difficult ?  What about processes ?  Libraries ?  Any other pitfalls I should
watch out for ?  Anyone else interested in cooperating on such a project ?
[Is it completely irrevelent, or crackpot... all suggestions considered]

Personally, I would much prefer to write such a compiler in C [on the grounds
that it then becomes easier to port the compiler to other systems]

Obviously, you'd get a free M2->C translator for the one-off conversion...

	Duncan.

-----------------------------------------------------------------------------
JANET address : dcw@uk.ac.ic.doc| Snail Mail :  Duncan White,
--------------------------------|               Dept of Computing,
  This space intentionally      |               Imperial College,
  left blank......              |               180 Queen's Gate,
  (paradoxical excerpt from     |               South Kensington,
  IBM manuals)                  |               London SW7
----------------------------------------------------------------------------
Tel: UK 01-589-5111 x 4982/4991
----------------------------------------------------------------------------