Re: Using C as a back end

"jacob navia" <jacob@jacob.remcomp.fr>
26 Oct 2000 02:51:53 -0400

          From comp.compilers

Related articles
[10 earlier articles]
Re: Using C as a back end predictor@my-deja.com (Pred.) (2000-10-23)
Re: Using C as a back end sweeks@my-deja.com (Stephen T. Weeks) (2000-10-23)
Re: Using C as a back end jaidi@fos.ubd.edu.bn (Pg Nor Jaidi Pg Tuah) (2000-10-26)
Re: Using C as a back end predictor@my-deja.com (Pred.) (2000-10-26)
Re: Using C as a back end ONeillCJ@logica.com (Conor O'Neill) (2000-10-26)
Re: Using C as a back end kst@cts.com (Keith Thompson) (2000-10-26)
Re: Using C as a back end jacob@jacob.remcomp.fr (jacob navia) (2000-10-26)
Re: Using C as a back end nr@labrador.eecs.harvard.edu (2000-10-31)
Re: Using C as a back end sweeks@my-deja.com (Stephen T. Weeks) (2000-10-31)
Re: Using C as a back end zs@ender.cs.mu.oz.au (2000-10-31)
Re: Using C as a back end thp@cs.ucr.edu (Tom Payne) (2000-10-31)
Re: Using C as a back end engler@Stanford.EDU (2000-10-31)
Re: Using C as a back end anton@mips.complang.tuwien.ac.at (2000-10-31)
[12 later articles]
| List of all articles for this month |

From: "jacob navia" <jacob@jacob.remcomp.fr>
Newsgroups: comp.compilers
Date: 26 Oct 2000 02:51:53 -0400
Organization: Wanadoo, l'internet avec France Telecom
References: 00-10-148 00-10-152
Keywords: C, translator, practice

C as a backend can be easied if the c compiler is easy to modify.


Consider that your language may be specified like this:
int a,b; double c;
... c = a/b; ...
The integers should be converted to doubles before the division. This is
just a few lines with lcc.


Or if you support overflow. I mean C specifies that a+b is actually
a+b mod bit_size. If your language doesn't like this, or supposes a
recovery mechanism, this means changing a few assembler macros in the
machine description. That's all.


In all this discussion we missed the linker. With an easy to change
linker, you can specify "load if needed" procedures, for
instance. They would be linked in only if they are called. This would
allow your language to build automatically default procedures for any
user defined type without any fear of code bloat.


And the debugger. Your language is easy to use if a windowed debugger
can be used to follow it step by step. The debugger (in step by step
mode) reads and scans each instruction before its executed. You can
add your own types, and generation hacks to inform the debugger where
to find the infos to display, arrange for your procedures to be called
from the debugger, and several other things.


Post a followup to this message

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