Re: Compiling to C (where C is used as misspelled assembly)

Darius Blasband <darius@phidani.be>
16 May 1997 23:38:45 -0400

          From comp.compilers

Related articles
Compiling to C (where C is used as misspelled assembly) bear@sonic.net (Ray Dillinger) (1997-05-14)
Re: Compiling to C (where C is used as misspelled assembly) fabre@gr.osf.org (Christian Fabre) (1997-05-16)
Re: Compiling to C (where C is used as misspelled assembly) fjh@mundook.cs.mu.OZ.AU (1997-05-16)
Re: Compiling to C (where C is used as misspelled assembly) chase@world.std.com (David Chase) (1997-05-16)
Re: Compiling to C (where C is used as misspelled assembly) darius@phidani.be (Darius Blasband) (1997-05-16)
Re: Compiling to C (where C is used as misspelled assembly) hbaker@netcom.com (1997-05-16)
Re: Compiling to C (where C is used as misspelled assembly) ramb@spring.epic.com (Ram Bhamidipaty) (1997-05-16)
Re: Compiling to C (where C is used as misspelled assembly) dwight@pentasoft.com (Dwight VandenBerghe) (1997-05-16)
Re: Compiling to C (where C is used as misspelled assembly) conway@mundook.cs.mu.OZ.AU (1997-05-17)
Re: Compiling to C (where C is used as misspelled assembly) fjh@mundook.cs.mu.OZ.AU (1997-05-17)
Re: Compiling to C (where C is used as misspelled assembly) monnier+/news/comp/compilers@tequila.cs.yale.edu (Stefan Monnier) (1997-05-17)
[7 later articles]
| List of all articles for this month |

From: Darius Blasband <darius@phidani.be>
Newsgroups: comp.compilers
Date: 16 May 1997 23:38:45 -0400
Organization: Phidani Software, Brussels
References: 97-05-183
Keywords: C, assembler

Ray Dillinger wrote:
> I've been looking for a good target language for compilation;
> ...
> However, this will violate every "reasonable" assumption a maker of C
> compiers will have about programming style. It will mean a program is
> compiled into a *single routine* of C code, with Goto destinations
> that might be more than 64K bytes away -- and no templates, no library
> functions linked, no header files, etc etc....
>
> Will modern C systems handle this?
> [Probably not. Machine generated source code always seems to break
> compilers designed for code written by humans. -John]


We have been using C as intermediate language for the YAFL compiler,
and that has proven to be reasonably easy. It is also true that our
model is closer to C than yours: we have been able to define
functions, locals, we make extensive use of the preprocessor, our
loops translate into C loops, etc... See http://www.phidani.be/yafl
for more information. The underlying C compilers have seldom been a
true problem.


For more exotic models, you might have a look at Mercury (see
http://www.cs.mu.oz.au/research/mercury) that uses some of gcc's
subtleties to by pass the limitations of the common C model
(restrictions to local gotos, for instance). They do support plain C
as well by using a set of rather intricate preprocessor macros.


On the other hand, I am not sure this (I mean, using gcc's multiple
extensions) is much less work than actually writing a reasonably naive
code generator from scratch., while these extensions, by performing
operations on registers beyond gcc's control, might (no evidence)
limit gcc's ability to produce optimal code.


Well...


Darius.
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.