Re: Is Assembler Language essential in compiler construction?

Hans Aberg <haberg_20080406@math.su.se>
Wed, 11 Feb 2009 15:57:39 +0100

          From comp.compilers

Related articles
Is Assembler Language essential in compiler construction? marco.m.petersen@gmail.com (2009-02-09)
Re: Is Assembler Language essential in compiler construction? mburrel@uwo.ca (Mike Burrell) (2009-02-10)
Re: Is Assembler Language essential in compiler construction? rpboland@gmail.com (Ralph Boland) (2009-02-10)
Re: Is Assembler Language essential in compiler construction? bartc@freeuk.com (Bartc) (2009-02-11)
Re: Is Assembler Language essential in compiler construction? tim.d.richards@gmail.com (Tim) (2009-02-11)
Re: Is Assembler Language essential in compiler construction? walter@bytecraft.com (Walter Banks) (2009-02-11)
Re: Is Assembler Language essential in compiler construction? haberg_20080406@math.su.se (Hans Aberg) (2009-02-11)
Re: Is Assembler Language essential in compiler construction? torbenm@pc-003.diku.dk (2009-02-11)
Re: Is Assembler Language essential in compiler construction? anton@mips.complang.tuwien.ac.at (2009-02-11)
Re: Is Assembler Language essential in compiler construction? anton@mips.complang.tuwien.ac.at (2009-02-11)
Re: Is Assembler Language essential in compiler construction? cfc@shell01.TheWorld.com (Chris F Clark) (2009-02-11)
Re: Is Assembler Language essential in compiler construction? lkrupp@pssw.com (Louis Krupp) (2009-02-11)
Re: Is Assembler Language essential in compiler construction? cr88192@hotmail.com (cr88192) (2009-02-12)
[20 later articles]
| List of all articles for this month |

From: Hans Aberg <haberg_20080406@math.su.se>
Newsgroups: comp.compilers
Date: Wed, 11 Feb 2009 15:57:39 +0100
Organization: Aioe.org NNTP Server
References: 09-02-021
Keywords: practice, assembler
Posted-Date: 11 Feb 2009 10:04:44 EST

marco.m.petersen@gmail.com wrote:
> I mean, if you wrote a program that converts code from BASIC to C++
> then calls another compiler to do the compilation process, wouldn't
> that be considered as a compiler?


Yes, formally a compiler just translates one computer language into
another. For example, an assembler translates into the machine code
language.


One uses T-diagrams to describe this:
      http://scifac.ru.ac.za/compilers/cha03g.htm
      http://en.wikipedia.org/wiki/Compiler


  > Is Assembler Language essential in compiler construction? I've read a
  > few e-Books on compiler construction and it always says that knowledge
  > of assembly is essential.


This leads to the question of boot-strapping and self-compilation,
described further down on the first link above. One can write an
assembler by writing some parts in machine code and let it self-compile,
a C-compiler by writing some parts in assembler and let it self-compile,
or a C++ or Haskell compiler (like GHC at least in the past) by letting
it generating C. Then some parts may still be written in assembler for
optimization reasons. A compiler may use an in-house intermediate
optimized for its portability and spectrum of supported languages (like
GCC, I think).


      Hans Aberg



Post a followup to this message

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