answersLogoWhite

0


Best Answer

A computer does not execute a program in a high level language. A computer executes a program in machine language. The high level language is converted into machine language by a compiler. Alternatively, an interpreter executes on the computer in machine language and the interpreter executes the high level language.

User Avatar

Wiki User

13y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

8y ago

A programming language that makes use of a interpreter usually involves a interpreter that has hardcoded instructions into [platform-specific or platform-agnostic] machine language. In other cases the interpreter can convert the high-level code into bytecode, a intermediary form of object code that usually can be optimized for faster execution instead of having to recompile into machine code every time your user runs the high-level code.

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

First, it is translated into machine code -- that's what compilers do. This process is no way simple -- there are very good text-books about the topic.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How does an interpreter translate high-level code to machine code?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

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 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 a computer interpreter?

An interpreter, or a translator, is a person who translates different languages. For an example, if a Chinese person and an American person can't understand each other, an intepreter can translate for both of them.


What is used to translate source code instructions into appropriate machine language instructions?

Languages are either "Compiled languages" or "interpreted languages": - A compiled language will use a compiler which is another program that checks your code and then converts it to the correct machine code for the machine it is intended to run on. You can only run the program after you have compiled it. A compiler can help spot syntax errors and certain semantic errors and will give you a "compilation error". - An Interpreted language can be ran directly as long as you have another program called the interpreter which translates your code into machine code whilst it is running. This means certain errors will not be caught before runtime (There is no concept of a compilation error) and so you won't know until runtime if certain errors are present in your code


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

Is used to translate high level language programme into machine code instruction?

Interpreter


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.


If you run a programme on compiler and interpreter then how can you come to know which is compiler and which is interpreter?

If source code requires a runtime in order to translate the source code into machine code, executing one statement at a time, then it is interpreted. If the source code has already been converted into machine code in advance, then it is compiled. Compiled code does not require a runtime. Note that compilers do not execute programs, they simply compile them. Your development environment may well execute the machine code once it is compiled, but that is not the job of the compiler, the IDE has simply launched the executable.


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 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 is a computer interpreter?

An interpreter, or a translator, is a person who translates different languages. For an example, if a Chinese person and an American person can't understand each other, an intepreter can translate for both of them.


What are the examples of compiler?

basically compiler is that convert an object code in to machine code and machine code is directly understood by a computer. assembler and interpreter are the examples of compilers. assembler is used to convert object code of assmebly language in machine code.


What is used to translate source code instructions into appropriate machine language instructions?

Languages are either "Compiled languages" or "interpreted languages": - A compiled language will use a compiler which is another program that checks your code and then converts it to the correct machine code for the machine it is intended to run on. You can only run the program after you have compiled it. A compiler can help spot syntax errors and certain semantic errors and will give you a "compilation error". - An Interpreted language can be ran directly as long as you have another program called the interpreter which translates your code into machine code whilst it is running. This means certain errors will not be caught before runtime (There is no concept of a compilation error) and so you won't know until runtime if certain errors are present in your code


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.


Is the translation of a high-level program to a machine language is done by applications known as compilers and interpreters?

Depends on the language you're using. C++, for instance, goes from...High-Level -> Compiler -> Machine CodeJava, on the other hand, is an interpreter language, needing a virtual machine (VM, or the JVM for Java) to run. For Java, it goes...High-Level -> Compiler -> Byte Code -> Interpreter -> Machine CodeHigh-level code is generally what programmers actually code in (unless they're insane or masochistic), and machine code is platform and computer specific binary that the local machine can actually run. Non-interpreter languages (C++, Pascal, COBOL, et cetera) are generally less portable (platform dependent), but, being "closer" to the local machine, more capable with hardware specific tasks. Interpreter languages (like Java) compile to an intermediate byte code format, which a platform dependent virtual machine (the interpreter, like the Java Virtual Machine) converts to platform dependent machine code. This makes it very portable, but less "familiar" with the local machine.For instance, all Java arrays are 16bit, for portability (unless, of course, you've got a lot of experience, then you can emulate 32 or 64bit arrays manually, but it's difficult). In non-interpreter languages, arrays are 16, 32, or 64bit (whatever the processor architecture being used is).Note: interpreters do not translate to machine code.


What is a compiler and an interpreter?

a compiler translates an entire program and then executes it while an interpreter translates and executes one line of a program at time


What reads a code statement converts it to one or more machine language instructions?

an interpreter Many flavors of BASIC could run as interpreters. One advantage is that it is possible for an interpreter's program to actually modify itself as it runs.