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

Stefan Monnier <monnier+/news/comp/compilers@tequila.cs.yale.edu>
17 May 1997 22:55:18 -0400

          From comp.compilers

Related articles
[4 earlier articles]
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)
Re: Compiling to C (where C is used as misspelled assembly) cdg@nullstone.com (Christopher Glaeser) (1997-05-17)
Re: Compiling to C (where C is used as misspelled assembly) conway@mundook.cs.mu.OZ.AU (1997-05-22)
Re: Compiling to C (where C is used as misspelled assembly) conway@mundook.cs.mu.OZ.AU (1997-05-22)
Re: Compiling to C (where C is used as misspelled assembly) Dave@occl-cam.demon.co.uk (Dave Lloyd) (1997-05-22)
Re: Compiling to C (where C is used as misspelled assembly) partain@dcs.gla.ac.uk (Will Partain) (1997-05-22)
Re: Compiling to C (where C is used as misspelled assembly) fjh@mundook.cs.mu.OZ.AU (1997-05-25)
[1 later articles]
| List of all articles for this month |

From: Stefan Monnier <monnier+/news/comp/compilers@tequila.cs.yale.edu>
Newsgroups: comp.lang.scheme,comp.compilers
Date: 17 May 1997 22:55:18 -0400
Organization: Compilers Central
References: 97-05-183
Keywords: C, assembler

Ray Dillinger <bear@sonic.net> writes:
> I've been looking for a good target language for compilation;
> And, I think a lobotomized subset of C does what I want.


As someone noticed, gcc's extensions can make your life easier. Also,
if you're willing to do heap-allocation instead of stack-allocation
(this requires mostly a copying-generational GC), Henry Baker's trick
(which basically consist in using a continuation-passing-style where
you call C functions but never return from them and every once in a
while you stop the whole thing and clean up the ever-growing stack via
a GC) can be useful too.


But unless you really badly need portability, my limited experience
has been that if you generate very low-level C, you might as well
generate assembly (at least for RISC chips, it's really
straightforward). This will save you from going through hoops to get
valid C code and will speed up compilation times. On another hand,
you loose portability and you can't take advantage of cc's (or gcc's)
optimisations, but they only work well with sufficiently high-level C
code.


                Stefan
--


Post a followup to this message

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