Do you write the first compiler in another programming language? And the fully rewrite the compiler once the first compiler is mature enough to produce reliable builds, compile the new compiler on that first compiler, in order to have a compiler that is written in the same language as the one it’s compiling?

If this is the case, and this might be a stupid question, why would want to? You’ll essentially be throwing away potentially years of work on that first compiler just to have a circularly compiling programming language? What benefits could this have to make the extra effort worth it?

  • @pinknoise@lemmy.ml
    link
    fedilink
    2
    edit-2
    2 years ago

    Bootstrapping software tends to be awkward sometimes. On old DEC machines the manual suggested to enter a program by hand, via switches in the front, that would load a program from the (hole punch) tape reader that would then load a program from the tape reader in a more space efficient way :D

    Many languages don’t bother, there are even operating systems that can’t compile themselves. Also you don’t need to throw the initial compiler away since it can be used to bootstrap from source on new platforms. (If you need that for whatever reason)