Re: Using C as a back end

Jim Granville <jim.granville@designtools.co.nz>
22 Oct 2000 01:12:14 -0400

          From comp.compilers

Related articles
Using C as a back end predictor@my-deja.com (Pred.) (2000-10-19)
Re: Using C as a back end jim.granville@designtools.co.nz (Jim Granville) (2000-10-22)
Re: Using C as a back end peteg@cse.unsw.edu.au (Peter Gammie) (2000-10-22)
Re: Using C as a back end frido@q-software-solutions.com (Friedrich Dominicus) (2000-10-22)
Re: Using C as a back end joachim_d@gmx.de (Joachim Durchholz) (2000-10-22)
Re: Using C as a back end jacob@jacob.remcomp.fr (jacob navia) (2000-10-22)
Re: Using C as a back end nr@labrador.eecs.harvard.edu (2000-10-22)
Re: Using C as a back end sjmeyer@www.tdl.com (2000-10-23)
[27 later articles]
| List of all articles for this month |
From: Jim Granville <jim.granville@designtools.co.nz>
Newsgroups: comp.compilers
Date: 22 Oct 2000 01:12:14 -0400
Organization: Mandeno Granville elect
References: 00-10-148
Keywords: C, translator

Pred. wrote:
> I have designed a language for which I'm hoping to create a compiler.
> Since I want a portable solution I was thinking about using a
> retargable C or C++ compiler in the back end along with appropriate
> assembler / linkers. Is this a good solution?
>
> I see the following pros and cons:
>
> PROS:
> 1. I don't have to learn about / write code generators for the various
> targets
> 2. "Tried'n'true" back end
> 3. Shorter time-to-market
>
> CONS:
> 1. Slower compilation (scan + parse occurs twice)
> 2. No control over new versions of the back end
>
> Have there been any work on good ways to transform one language into C
> source?


A number of compilers produce C, look at the Modula-2 FAQ for some.


http://www.arjay.bc.ca/Modula-2/m2faq.html


Some also produce Java ( see the MHC work ).


A CON you missed is perhaps the main operational one : Debug
Connection back to the original Source. This will impact far more than
your 1. 2.


Does anyone know of work to solve this one ?


1) With modern PC's compile time is a complete non-issue,
      ( so much, that make is rather redundant )
2) Version control is not too risky - you can always archive/freeze
      with any version of compiler.


Certainly, given the public domain nature of C's ( Borland,Watcom ) they
can make usefull 'assemblers'


--
======= 80x51 Tools & IP Specialists =========
= http://www.DesignTools.co.nz
[I disagree about compile time; most modern compilers are very slow. By
comparison, the Dartmouth Basic compiler running on a 1 mips machine could
compile most user programs in under 1/10 second, from RUN to when it started
running. -John]



Post a followup to this message

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