From: | Hans Aberg <haberg_20080406@math.su.se> |
Newsgroups: | comp.compilers |
Date: | Sun, 15 Feb 2009 00:48:33 +0100 |
Organization: | Aioe.org NNTP Server |
References: | 09-02-021 09-02-035 09-02-054 |
Keywords: | design |
Posted-Date: | 15 Feb 2009 18:34:40 EST |
Tony wrote:
>> Yes, formally a compiler just translates one computer language into
>> another. For example, an assembler translates into the machine code
>> language.
>
> I would say that is simply translation and not compilation because there is
> no intermediate representation. The IR (and the creation of it via
> lex/parse/semantic analysis before code generation) is what I think
> distinguishes compilers from interpreters and translators.
From the formal point of view, all those translates one computer
language into another - they just have different practical form. From
what I checked, a compiler may have intermediate code, created typically
for achieving some machine independence, but is not required to have it.
One book, by Robin Hunter, "Compilers...", says (p. 209) that the
procedure of translating intermediate code into machine code is
sometimes called translation in order to distinguish from the process of
producing intermediate code. The Haskell interpreter Hugs I think
produces some intermediate code which it interprets.
So I think that the word "compiler" can be used to denote computer
language translators in general, at least in formal discussions about
language translations.
Hans Aberg
Return to the
comp.compilers page.
Search the
comp.compilers archives again.