Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.compilers > #1439

Re: self-hosting, was Writing A Plain English Compiler

From anton@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups comp.compilers
Subject Re: self-hosting, was Writing A Plain English Compiler
Date 2014-11-12 08:46 +0000
Organization Institut fuer Computersprachen, Technische Universitaet Wien
Message-ID <14-11-031@comp.compilers> (permalink)
References (3 earlier) <14-11-014@comp.compilers> <14-11-016@comp.compilers> <14-11-020@comp.compilers> <14-11-028@comp.compilers> <14-11-029@comp.compilers>

Show all headers | View raw


"BartC" <bc@freeuk.com> writes:
>It does, however, run into problems, such as frequently ending up with
>non-working compilers and/or support programs, and with most of the bridges
>burnt! Then recovering can be tricky.

To deal with that, you have a "stable" and executable (or buildable)
version somewhere, and make sure that your compiler builds with that
version.  So if the current version no longer builds with itself, you
build it with the stable version; for that you also need a simple way
to switch from building with the current version (default) to building
with the stable version.

E.g., if Gforth no longer builds itself because of some bug, we do
"make distclean" and invoke the script "BUILD_FROM_SCRATCH", which
invokes the stable version of Gforth for the self-hosting.

>It is possible to compile a compiler with itself, and perhaps even repeat
>that again, but still end up with something that apparently still works, but
>has now developed a bug. Perhaps because it affects some code that is not
>executed in the compiler, because the particular language construct to
>invoke the bug doesn't occur in the compiler source.

Sure, a test cannot prove the absence of bugs.  You need additional
tests, especially for features not exercised in the compiler (say,
vectorization).

>[It's time to reread Ken Thompson's Turing award lecture,
>available here: http://cm.bell-labs.com/who/ken/trust.html
>-John]

Self-hosting does not make binary distributions of code (including
compilers) any more prone to hidden functions.  These days we have
even more stuff to worry about, with stuff like system-management mode
and VM functionality making it very easy to hide functions, and huge
amounts of code in the firmware of the PC, or even in the firmware of
USB sticks.

- anton
--
M. Anton Ertl
anton@mips.complang.tuwien.ac.at
http://www.complang.tuwien.ac.at/anton/

Back to comp.compilers | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Writing A Plain English Compiler "Gerry Rzeppa" <gerry.rzeppa@pobox.com> - 2014-11-04 15:50 -0600
  Re: Writing A Plain English Compiler Joshua Cranmer 🐧 <Pidgeot18@verizon.net> - 2014-11-05 00:54 -0600
    Re: Writing A Plain English Compiler "Gerry Rzeppa" <gerry.rzeppa@pobox.com> - 2014-11-06 18:52 -0600
      Re: Writing A Plain English Compiler Joshua Cranmer 🐧 <Pidgeot18@verizon.net> - 2014-11-07 22:54 -0600
        Re: Writing A Plain English Compiler "Gerry Rzeppa" <gerry.rzeppa@pobox.com> - 2014-11-08 02:41 -0600
        Re: Writing A Plain English Compiler "Gerry Rzeppa" <gerry.rzeppa@pobox.com> - 2014-11-08 03:46 -0600
          Re: Writing A Plain English Compiler "BartC" <bc@freeuk.com> - 2014-11-09 01:16 +0000
            Re: Writing A Plain English Compiler "Gerry Rzeppa" <gerry.rzeppa@pobox.com> - 2014-11-10 14:37 -0600
            Re: self-hosting, was Writing A Plain English Compiler Richard Hable <portempa@aon.at> - 2014-11-11 19:50 +0100
              Re: self-hosting, was Writing A Plain English Compiler "BartC" <bc@freeuk.com> - 2014-11-11 23:33 +0000
                Re: self-hosting, was Writing A Plain English Compiler anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2014-11-12 08:46 +0000
                Re: self-hosting, was Writing A Plain English Compiler "BartC" <bc@freeuk.com> - 2014-11-12 11:15 +0000
              Re: self-hosting, was Writing A Plain English Compiler anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2014-11-12 08:40 +0000
    Re: Writing A Plain English Compiler "BartC" <bcas@freeuk.com> - 2014-11-07 11:36 +0000
    Re: Writing A Plain English Compiler George Neuner <gneuner2@comcast.net> - 2014-11-07 16:23 -0500
      Re: Writing A Plain English Compiler Richard Hable <portempa@aon.at> - 2014-11-08 17:22 +0100
      Re: Writing A Plain English Compiler Joshua Cranmer 🐧 <Pidgeot18@verizon.invalid> - 2014-11-08 10:48 -0600
        Re: language design models, was Writing A Plain English Compiler George Neuner <gneuner2@comcast.net> - 2014-11-09 14:30 -0500
          Re: language design models, was Writing A Plain English Compiler "Gerry Rzeppa" <gerry.rzeppa@pobox.com> - 2014-11-10 03:29 -0600
          Re: Writing A Plain English Compiler Tomasz Kowaltowski <tk@ic.unicamp.br> - 2014-11-10 09:13 -0200
            Re: Writing A Plain English Compiler "Gerry Rzeppa" <gerry.rzeppa@pobox.com> - 2014-11-10 17:19 -0600
      Re: matching tasks to languages, was Writing A Plain English Compiler Gene Wirchenko <genew@telus.net> - 2014-11-10 15:37 -0800
    Re: Writing A Plain English Compiler Martin Ward <martin@gkc.org.uk> - 2014-11-10 22:56 +0000
  Re: Writing A Plain English Compiler "BartC" <bcas@freeuk.com> - 2014-11-07 11:39 +0000
    Re: Writing A Plain English Compiler "BartC" <bc@freeuk.com> - 2014-11-08 00:35 +0000
  Fundamentals for a Compiler and Language (was: Writing A Plain English Compiler) federation2005@netzero.com - 2014-12-29 13:30 -0800

csiph-web