Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.compilers > #2116
| From | Kaz Kylheku <157-073-9834@kylheku.com> |
|---|---|
| Newsgroups | comp.compilers |
| Subject | Re: Compiler implementation language preference ? |
| Date | 2018-11-10 04:20 +0000 |
| Organization | Aioe.org NNTP Server |
| Message-ID | <18-11-004@comp.compilers> (permalink) |
| References | <18-05-009@comp.compilers> <18-11-001@comp.compilers> |
On 2018-11-09, rockbrentwood@gmail.com <rockbrentwood@gmail.com> wrote: > On Tuesday, May 22, 2018 at 12:39:07 PM UTC-5, Michael Justice wrote: >> Is there any preference to writing a compiler in say c instead of say >> java, fortran, basic etc? I ask cause i see many of the projects using >> either c or c++ instead of other programming languages. >> >> nullCompiler >> [Mostly people use what they're used to, or in languages that are easy >> to bootstrap on the machines they want to use. > > A test of whether the language, itself, is worth using -- assuming it is a > general purpose language -- is whether you'd be willing to write the compiler, > itself, in it! I put up a branch (and heavily recoded) version of cparse on my > machine, which is in C and has 3 layers of self-bootstrapping. GCC has several > layers of self-bootstrpping, depending on what you implement from it (and > distressingly, it has -- as of version 6 -- acquired *dependencies* on > libraries further upstream! That's a major no no!) A nice bootstrapping method is to build an interpreter for the language also in some widely available language (like C). The compiler can be executed by the interpreter to compile itself, plus any other run-time support code also written in that language. If the compiler produces that widely-used systems programming language, then it can just be redistributed in compiled form and an interpreter need not be included. That's a tough way to evolve the language, though. An interpreter gives you a version of the language that is immune to bootstrapping chicken-egg problems and provides a reference model for what compiled code should be doing. You can always revert to the interpreter when things go horribly wrong. When you make modifications to the compiler and they are so wrong they break the compiler, you don't have to revert them. Just blow off all the compiled materials, try too fix your work in the compiler and just bootstrap from scratch through the stable interpreter. You never need a last-known-good copy of the compiler in your workspace.
Back to comp.compilers | Previous | Next — Previous in thread | Next in thread | Find similar
Compiler implementation language preference ? Michael Justice <nullcompiler@gmail.com> - 2018-05-22 04:58 -0400
Re: Compiler implementation language preference ? w.clodius@icloud.com (William Clodius) - 2018-05-23 10:14 -0600
Re: Compiler implementation language preference ? Walter Banks <walter@bytecraft.com> - 2018-06-07 12:58 -0400
Re: Compiler implementation language preference ? rockbrentwood@gmail.com - 2018-11-09 14:29 -0800
Re: Compiler implementation language preference ? Kaz Kylheku <157-073-9834@kylheku.com> - 2018-11-10 04:00 +0000
Re: Compiler implementation language preference ? Kaz Kylheku <157-073-9834@kylheku.com> - 2018-11-10 04:20 +0000
Re: Compiler implementation language preference ? Richard <portempa@aon.at> - 2018-11-10 15:06 +0100
Re: Compiler implementation language preference ? Walter Banks <walter@bytecraft.com> - 2018-11-10 21:46 -0500
Re: Compiler implementation language preference ? Nick <ibeam2000@gmail.com> - 2018-11-13 02:14 -0800
Re: Compiler implementation language preference ? Aaron Gray <aaronngray@gmail.com> - 2018-12-19 11:54 -0800
Re: Compiler implementation language preference ? steve kargl <sgk@REMOVEtroutmask.apl.washington.edu> - 2018-12-19 23:19 +0000
Re: Compiler implementation language preference ? Aaron Gray <aaronngray@gmail.com> - 2018-12-21 04:17 -0800
csiph-web