For this assignment, the following four articles relating to source code, executable code, interpreters, and compilers were read:
- Source vs. Object Code: A False Dichotomy, by David S. Touretzky
- •Source code - http://www.webopedia.com/TERM/S/source_code.html
- •Interpreters and compilers -http://www.webopedia.com/TERM/I/interpreter.html
- •Assembly - http://www.webopedia.com/TERM/A/assembly_language.html
According to the article by David S. Touretzkey, the perceived and often taught differences between source code and executable do not really exist. They have just been taught as an easy way for non programmers to understand the process. According to David S. Touretzkey, people can read machine language, it’s just not very easy or efficient to do so. Also, machines can in turn, execute source code it would just take a very long time to do.
The webopedia article, about source code, listed above gives this concise description of the process:
“Initially, a programmer writes a program in a particular programming language. This form of the program is called the source program, or more generically, source code. To execute the program, however, the programmer must translate it into machine language, the language that the computer understands. The first step of this translation process is usually performed by a utility called a compiler. The compiler translates the source code into a form called object code. Sometimes the object code is the same as machine code; sometimes it needs to be translated into machine language by a utility called an assembler.”
The process can be confusing for a lay person so I have “compiled” an analogy to everyday life that may help beginners to understand. First off, let’s say a very intellectual Latin speaking professor decided to write a book for toddlers on a subject like learning shapes. This very high level professor might write a book in Latin that is very eloquent and has lots of multi-syllable words and many layers descriptions, procedures, and instructions. Well, when his children’s book editor receives the first copy, they realize that very few toddlers if any would be able to understand the original (Source Code) draft of the book. Some might eventually be able to understand the book , but it would take them a long time. So, the editor decides to commission a person who speaks Latin and English. This person’s role will not only be to translate the language, but break it down into lower level terms that a toddler can understand. In the scenario I just described, the book the Latin professor writes would be akin to the C++ language. The children’s book editor recruited another person to interpret and compile a simple toddler’s book. The end result would be like an executable program in machine language.
No comments:
Post a Comment