On Tue, Dec 13, 2011 at 08:30:22PM +0000, Philipp Kern wrote: > But then I don't see how you could avoid circular build-dependencies > with compilers written in their own language. fpc/fp-compiler does the > same.
You can avoid it by having a bootstrap compiler written in another suitable language, which is capable (even if just) of building the real compiler. So you write two compilers, A and B. A is written in, say, AWK or Perl, and compiles the source code for B into executable code. The executable B is then used to actually compile software written in the language in question. Indeed, during the package build, you would build the compiler first with A, and then again with B, and the binary package would contain just the binary built with B. The benefit of the simple bootstrapping compiler A is that it can often be written quite simply (and, indeed, might not be a real compiler at all, just an interpreter), and does not need, for example, to have any optimization phase at all. The only program it ever needs to compile is B. Even so, writing A is a fair bit of effort, and many language implementers don't do that. Which makes things harder for distros, but nobody cares about the poor distro developer. -- Freedom-based blog/wiki/web hosting: http://www.branchable.com/
signature.asc
Description: Digital signature