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
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.