Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

1.

Source code: Source code and object code refer to the "before" and "after" versions of a computer program that is compiled (see compiler) before it is ready to run in a computer. The source code consists of the programming statements that are created by a programmer with a text editor or a visual programming tool and then saved in a file. For example, a programmer using the C language types in a desired sequence of C language statements using a text editor and then saves them as a named file. This file is said to contain the source code. It is now ready to be compiled with a C compiler and the resulting output, the compiled file, is often referred to as object code. The object code file contains a sequence of instructions that the processor can understand but that is difficult for a human to read or modify. For this reason and because even debugged programs often need some later enhancement, the source code is the most permanent form of the program. When you purchase or receive operating system or application software, it is usually in the form of compiled object code and the source code is not included. Proprietary software vendors usually don't want you to try to improve their code since this may created additional service costs for them. Lately, there is a movement to develop software (Linux is an example) that is open to further improvement and here the source code is provided. In large program development environments, there are often management systems that help programmers separate and keep track of different states and levels of code files. For script (noncompiled or interpreted) program languages, such as JavaScript, the terms source code and object code do not apply since there is only one form of the code.
Code written by a programmer in a high-level language and readable by people but not computers. Source code must be converted to object code or machine language before a computer can read or execute the program.

source code - program instructions written as an ASCII text file; must be translated by a compiler or interpreter or assembler into the object code for a particular computer before execution ASCII text file - a text file that contains only ASCII characters without special formatting

2. Interpreter: An interpreted language is a programming language that is compiled into machine readable code at the moment it is run by the languages interpreter. Examples of interpreted languages are Perl, PHP, Ruby, and Python. If you write a program using an interpreted language, you must have the interpreter installed to run that program. This is in contrast to a compiled language - like C, C++, or Java. These languages are precompiled or compiled into machine readable code once by a language compiler. This creates an executable in the machine's native language that can then be run many times. Interpreted language is a programming language in which programs are 'indirectly' executed ("interpreted") by an interpreter program. This can be contrasted with a compiled language which

is converted into machine code and then 'directly' executed by the host CPU. Theoretically, any language may be compiled or interpreted, so this designation is applied purely because of common implementation practice and not some essential property of a language. Indeed, for some programming languages, there is little performance difference between an interpretive- or compiled-based approach to their implementation. Many languages have been implemented using both compilers and interpreters, including BASIC, C, Lisp, Pascal, and Python. While Java is translated to a form that is intended to be interpreted, just-in-time compilation is often used to generate machine code. The Microsoft .NET Framework languages always compile to Common Intermediate Language (CIL) which is then just-in-time compiled into native machine code. Many Lisp implementations can freely mix interpreted and compiled code. These implementations also use a compiler that can translate arbitrary source code at runtime to machine code.
A high-level programming language translator that translates and runs the program at the same time. It converts one program statement into machine language, executes it, and then proceeds to the next statement. This differs from regular executable programs that are presented to the computer as binarycoded instructions. Interpreted programs remain in the source language the programmer wrote in, which is human readable text. Slower, But Easier to Test Interpreted programs run slower than their compiler counterparts. Whereas the compiler translates the entire program before it is run, interpreters translate a line at a time while the program is being run. However, it is very convenient to write an interpreted program, since a single line of code can be tested interactively. Some languages can be both interpreted and compiled, in which case a program may be developed with the interpreter for ease of testing and debugging and later compiled for production use. See JIT compiler. The Runtime Interpreter Must Be Present Interpreted programs must always be run with the interpreter, commonly called a runtime module. For example, in order to run a BASIC or Foxbase program, the BASIC or Foxbase interpreter must be running as well. Interpreted Vs. Intermediate Languages Interpreted languages also differ from intermediate languages such as Java, which are partially converted but still require a runtime module (see Java and Java virtual machine).

Compilers and Interpreters


Compiled programs (right) are translated into the machine language of the target computer. Interpreted programs (left and center) are either kept in their original source code or are precompiled into an intermediate form. In both cases, an interpreter is required to translate the program into machine language at runtime, whereas the compiled program is "ready to go."

Compiler:

You might also like