Editing 303: Compiling

Jump to: navigation, search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 10: Line 10:
 
Computer programming involves writing instructions for a computer to follow, in a specific {{w|programming language}}, which is largely human readable and writable, at least to programmers who understand that language.  However, for the computers to follow instructions, they need to be given {{w|machine code}} β€” the actual "language" that computers "speak" and one that ''can'' be written directly with the correct tools, but would be too tedious and error-prone for just about any practical modern project where alternatives exist, where anything more than a {{w|%22Hello,_World!%22_program|Hello World}} could be awkward to implement straight into machine-code.
 
Computer programming involves writing instructions for a computer to follow, in a specific {{w|programming language}}, which is largely human readable and writable, at least to programmers who understand that language.  However, for the computers to follow instructions, they need to be given {{w|machine code}} β€” the actual "language" that computers "speak" and one that ''can'' be written directly with the correct tools, but would be too tedious and error-prone for just about any practical modern project where alternatives exist, where anything more than a {{w|%22Hello,_World!%22_program|Hello World}} could be awkward to implement straight into machine-code.
  
βˆ’
Conversion from the more conveniently human-writable code into {{w|computer-executable files}} is performed by {{w|Interpreter_(computing)|interpreters}} or {{w|compilers}}.  Interpreters (e.g. that for {{w|PHP}} for one example) generally read through the code, or script, each line at a time as and when required, and has to do a lot of work with various processing overheads and the risk of hitting an invalid instruction or mistake in syntax that it can't handle.  It also requires that a relevant version of the interpreter exist on any machine that has to run the script and perhaps some additional knowledge by the end-user.
+
Conversion from the more conveniently human-writable code into {{w|computer-executable files}} is performed by {{w|Interpreter_(computing)|interpreters}} or {{w|compilers}}.  Interpreters (e.g. that for {{w|PHP}} for one example) generally read through the code, or script, each line at a time as and when required, and has to do a lot of work with various processing overheads and the risk of hitting an invalid instruction or mistake in syntax that it can't handle.  It also requires that a relevent version of the interpreter exist on any machine that has to run the script and perhaps some additional knowledge by the end-user.
  
 
For widely distributed (and especially commercial) programs, some form of compilation will instead be used.  Compiling may have just one computer system read through the man-written code and (barring errors) produces the equivalent stand-alone and direct machine-readable code, suitable for a given range of computers.  This process might involve several passes to check for 'obvious' errors in the code, as well as converting some programming concepts that are easiest for humans to understand into equivalent concepts that may be far easier for the computer to work with.
 
For widely distributed (and especially commercial) programs, some form of compilation will instead be used.  Compiling may have just one computer system read through the man-written code and (barring errors) produces the equivalent stand-alone and direct machine-readable code, suitable for a given range of computers.  This process might involve several passes to check for 'obvious' errors in the code, as well as converting some programming concepts that are easiest for humans to understand into equivalent concepts that may be far easier for the computer to work with.

Please note that all contributions to explain xkcd may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see explain xkcd:Copyrights for details). Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to solve the following CAPTCHA:

Cancel | Editing help (opens in new window)