ANSWERS: 3
  • Compilers compile program source code into runnable programs (or "binaries"). Some programming languages, such as C and its brother C++, have to be compiled before they will run on most computers. (It's possible that someone has created a C interpreter, but they are certaily not in common use.) Compilation means reading the source code - which, while not English by any stretch, is comparatively easy for humans to read - and translating it into raw machine code - zeroes and ones that the computer's specific CPU chip can understand and run quickly. Frequently, the same source code can be compiled on machines with different CPUs and produce two different binaries, neither of which would run on the other machine unaltered. (This is part of why so much Unix software is distributed as source - with an OS that runs on so many different kinds of chips, any other distribution method would be unwieldy.) It's a bit like baking bread. The source code is the dough - humans can still alter its composition, but it's not really edible yet. It has to be put in the oven - the compiler - before it's ready for consumption. (This metaphor is not really so great, but I like it because some languages, notably Java and Python, can be compiled part way, into a "bytecode" language that isn't specific to any one chip, and then finished by a "just-in-time" compiler when it's time to run them. It's just kind of satisfying to call a program "half-baked" for no reason.)
  • It is not strictly necessary for a compiler to generate machine code; any lower-level code will do (e.g. Scheme to C compilers, Java/Python bytecode compilation). A very common compiler (or compiler collection) is GCC, the GNU Compiler Collection. The definitive reference book is the "Dragon Book" ("Compilers") by Aho et. al.
  • A compiler translates an entire high-level language into machine language before it can execute and tells you if you have used a programming language correctly.

Copyright 2023, Wired Ivy, LLC

Answerbag | Terms of Service | Privacy Policy