Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news.iecc.com!.POSTED!nerds-end From: anton@mips.complang.tuwien.ac.at (Anton Ertl) Newsgroups: comp.compilers Subject: Re: self-hosting, was Writing A Plain English Compiler Date: Wed, 12 Nov 2014 08:40:16 GMT Organization: Institut fuer Computersprachen, Technische Universitaet Wien Lines: 28 Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <14-11-030@comp.compilers> References: <14-11-004@comp.compilers> <14-11-005@comp.compilers> <14-11-007@comp.compilers> <14-11-014@comp.compilers> <14-11-016@comp.compilers> <14-11-020@comp.compilers> <14-11-028@comp.compilers> NNTP-Posting-Host: news.iecc.com X-Trace: miucha.iecc.com 1415783182 31785 2001:470:1f07:1126:0:676f:7373:6970 (12 Nov 2014 09:06:22 GMT) X-Complaints-To: abuse@iecc.com NNTP-Posting-Date: Wed, 12 Nov 2014 09:06:22 +0000 (UTC) Keywords: debug, practice Posted-Date: 12 Nov 2014 04:06:22 EST X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com Xref: csiph.com comp.compilers:1438 Richard Hable writes: >On 11/09/14 02:16, BartC wrote: > >> Self-hosting (implementing a language in itself) is a nice touch, but >> I don't think it's that important, perhaps because people are >> realising that the best language to implement a compiler in, is not >> necessarily the language that is being compiled. Unless of course you >> are trying to use a single language for everything.) > >I think, the main advantage of self-hosting is that it can be used as >one big unit test: you can compile the compiler with itself, use the >resulting compiler to compile itself again, and check if the result is >exactly the same. Yes, having additional testing for your compiler is one advantage (although I would not call it a unit test). Another reason to self-host a compiler is the signal it sends: If you claim that your language is general-purpose, and you write the compiler for it in a different language, you are obviously not very convinced of the capabilities of your language, so why should anybody else use it? - anton -- M. Anton Ertl anton@mips.complang.tuwien.ac.at http://www.complang.tuwien.ac.at/anton/