answersLogoWhite

0


Best Answer

A traditional interpreter interprets the source code instructions at runtime, and executes them directly. Compiling the instructions into machine code is not part of of a traditionally interpreter's design.

However, many modern interpreters work differently from traditional interpreters. In the traditional concept, an interpreter would digest the exact source code instructions at runtime, parsing "if" and "else" and so forth.

Most modern interpreters compile (!) the source code into code fit for a virtual machine (sometimes called hypercode or p-code). This virtual machine is implemented as an interpreter, which interprets and executes the stream of hypercode instructions at runtime. This is more efficient, since the interpreter doesn't have to handle surplus input (such as comment), and can rely on the input to be pre-validated for syntactic and, to some extend, semantic correctness.

Most modern virtual machine interpreters support another compilation step at runtime, typically called just-in-time compilation or JIT for short. With JIT, the virtual machine translates portions of the hypercode into real machine code at runtime, thus improving execution speed for repeatedly executed code.

Popular programming languages such as Java or the .NET languages all work on this principle.

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Why does an interpreter not convert source code into machine language?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

The compiler is responsible for what?

its just convert the source language of a program to target language at once.....whereas interpreter do it line wise....


What application will be used to convert an assembly language source program into machine language?

An Assembler converts assembly language instructions into machine language.


Is jvm a compiler?

Basically they do the same: converting from one level of language into another. A compiler converts high level language (programming language like java) into machine-language. That is language a computer understands. An interpreter converts high level language into an intermediate level. When a program is exectuted, that intermediate level is reconverted to machine language.


What is the difference between compilar and interpreter?

compiler is a software translator used in ProgrammingLanguage: C,C++, Java etc ). This used for to translate High level language to Machine independent language. Interpreter is used to translate source code to machine code by line by line.


Is there any chance a computer that convert the program into machine language is called as a interpreter?

No. Computers do not convert program source code into machine code, period. That job is the responsibility of another piece of software, known as the interpreter or compiler, a machine code program which effectively tells the computer how to perform the translation from source code to machine code. The computer cannot do this job by itself as computers only understand machine code and nothing else. An interpreter simply converts each statement of source code into the equivalent machine code and executes it, one statement at a time. This is extremely slow because subroutines that are called many times must be translated each time they are called, for instance. Thus the source code must always be executed within the interpreter software. A compiler, on the other hand, converts the entire source program into object code which can then be linked to produce the required machine code. Once linked, the machine code will execute without any further interpretation, and is therefore known as a standalone executable.

Related questions

The compiler is responsible for what?

its just convert the source language of a program to target language at once.....whereas interpreter do it line wise....


How can text be converted into a language that computers understand?

Source code is translated into machine code by an interpreter, a compiler or an assembler, depending on the language that was used to write the source code.


What application will be used to convert an assembly language source program into machine language?

An Assembler converts assembly language instructions into machine language.


Is jvm a compiler?

Basically they do the same: converting from one level of language into another. A compiler converts high level language (programming language like java) into machine-language. That is language a computer understands. An interpreter converts high level language into an intermediate level. When a program is exectuted, that intermediate level is reconverted to machine language.


How is Compiler Different from Interpretor?

A traditional compiler converts the source code to machine code; many recent compilers convert the source code to some intermediate language instead. An interpreter runs the source code directly, which means the source code is basically "interpreted" one line at a time.


What is the difference between compilar and interpreter?

compiler is a software translator used in ProgrammingLanguage: C,C++, Java etc ). This used for to translate High level language to Machine independent language. Interpreter is used to translate source code to machine code by line by line.


Is there any chance a computer that convert the program into machine language is called as a interpreter?

No. Computers do not convert program source code into machine code, period. That job is the responsibility of another piece of software, known as the interpreter or compiler, a machine code program which effectively tells the computer how to perform the translation from source code to machine code. The computer cannot do this job by itself as computers only understand machine code and nothing else. An interpreter simply converts each statement of source code into the equivalent machine code and executes it, one statement at a time. This is extremely slow because subroutines that are called many times must be translated each time they are called, for instance. Thus the source code must always be executed within the interpreter software. A compiler, on the other hand, converts the entire source program into object code which can then be linked to produce the required machine code. Once linked, the machine code will execute without any further interpretation, and is therefore known as a standalone executable.


How do you change source code into machine code?

A program called a compiler, or sometimes an assembler (depending on the programming language) does this for you. You write the source code, then invoke the program that will convert this into machine language.


How do you convert higher level language into lower level language?

Not only can we but we have to! Machine code is the only language understood by the computer, thus all languages, both low and high level, must be converted to machine code in order to execute. Most compiled languages can produce low-level symbolic code (assembly language), but not all, especially those that compile to byte code rather than machine code. However, all code has to be compiled or interpreted to machine code at some point and machine code can be disassembled to produce low-level symbolic code.


What are the similarities between compiler and interpreter?

Both compiler and interpreter are the language programs that translates source program into machine code or we can say object code. Both are used to find errors in source program.


What works with one source statement at a time translating it to machine level instructions?

Are you asking about an "interpreter"? That's part of a computer language that reads a line of code and breaks it down into machine code. The Interpreter works with one source statement at a time, reading it, translating itto machine-level instructions, executing the resulting binary instructions, and then moving on to the next source statement. Almost no real interpreters generate any machine code, they simply interpret the source code and directly do what it says using machine code built into the interpreter when it was originally written. Machine code is generated by compilers, to permit repeated execution without having to reload the compiler each time (as one must with an interpreter).


What are the names of 2 type of language translators?

Two types of language translators are: a compiler, which translates the entire source code into machine code before running the program, and an interpreter, which translates and executes the source code line by line.