Re: Using C as a back end

Jim Granville <>
22 Oct 2000 01:12:14 -0400

          From comp.compilers

Related articles
Using C as a back end (Pred.) (2000-10-19)
Re: Using C as a back end (Jim Granville) (2000-10-22)
Re: Using C as a back end (Peter Gammie) (2000-10-22)
Re: Using C as a back end (Friedrich Dominicus) (2000-10-22)
Re: Using C as a back end (Joachim Durchholz) (2000-10-22)
Re: Using C as a back end (jacob navia) (2000-10-22)
Re: Using C as a back end (2000-10-22)
Re: Using C as a back end (2000-10-23)
[27 later articles]
| List of all articles for this month |

From: Jim Granville <>
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:
> 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
> 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.

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 =========
[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.