answersLogoWhite

0


Best Answer

All programming languages need to be converted to machine code. Machine code is the native language of the machine; it is the only language understood by the machine. When we write programs in other languages they must be translated into machine code. To achieve that, we need to write a program to perform the translation for us.

For this we can either use an assembler, a compiler or an interpreter, all of which are machine code programs. Assemblers can only be used with assembly languages, which are low-level symbolic languages that translate near 1:1 with the machine code. The machine code can be saved and executed without further translation. However, assembly languages are not portable; each machine architecture has its own specific version of machine code and therefore requires its own specific assemblers to produce it. To port the code to another architecture you essentially have to re-write the entire source code. There are tools (pre-processors) that can help make the task easier but it's by no means a straightforward process.

[The reverse of assembling is disassembling, which converts machine code into a low-level language that is similar to assembly but is known as disassembly. However, since an assembler strips out all variable names and user comments, a disassembler cannot restore the original assembly language code. Indeed it is impossible to restore the original source code no matter what language was used. Disassembly is as good as it gets.]

All high-level languages are either compiled or interpreted or are both compiled and interpreted.

Compiled languages compile the entire source code into machine code, much like assembly language but with a higher level of abstraction between the source and the machine code. As with assembly languages, the machine code can be saved and executed without any further translation. Being more abstract, compiled languages are much easier to port to other architectures than assembly languages. However they must still be compiled separately upon each architecture. The most popular examples of compiled languages are C and C++.

Interpreted languages do not translate the entire source code, they step through the source code one statement at a time, converting each statement to machine code and executing it before moving onto the next statement. This has the advantage over compiled languages in that you do not have to wait for the entire program to compile before executing the program. A compiled language program can take several minutes to compile, whereas an interpreted language can be executed immediately. However, the need to interpret every statement before executing it incurs a performance penalty. With compiled languages, you only pay the cost during compilation; once compiled, you do not need the compiler. Interpreted languages cannot execute without the interpreter, but any machine that has a suitable interpreter can execute the same source code regardless of which machine architecture it was written on. The most popular interpreted language is BASIC since it is the language most programmers learn before moving onto other languages.

Languages that are both compiled and interpreted use a compiler to produce an intermediate source known as byte code. Byte code is not machine code, it still has to be interpreted, however the byte code "statements" are much simpler to interpret than an interpreted language's statements thus it performs much better. Also, unlike compiled languages, the compiled byte code is highly portable. The best example of such a language is Java which compiles to Java byte code suitable for interpretation by the Java virtual machine (JVM). Given that virtually all platforms provide a JVM implementation, it's no surprise that Java is by far the most popular application programming language in use today. However, it's lack of low-level features limits its usefulness in non-application fields such as driver software, operating system kernels and embedded systems software. Its performance and memory consumption also leaves a lot to be desired, however it's ease-of-use makes it a good stepping stone to learning C++.

User Avatar

Wiki User

9y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What function does an interpreter perform with the instructions in a high level programming language?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What kind of program is interpreters?

An interpreter is a specialized kind of computer program. This program executes instructions written in a programming language that is not the native coding.


What is an Interpreter used for in programming?

An interpreter is a computer program that executes the instructions written in a high level programming language. It can also preform the translation of a high level language to equivalent machine level code. But unlike compiler, an interpreter will compile the code line by line, i.e. each line will be translated to machine level language.Read more: What_ias_computer_interpreter


Does C language has a interpreter?

There might be C language interpreters, but they have no or minimal importance in actual programming.


Is the instructions programmers have written in a higher level language?

"BASIC" is not a program, it is a programming language. A particular BASIC-interpreter or IDE may have been written in a high level language, maybe even in BASIC (C is more plausible though).


What are the roots of the AWK programming language?

The AWK programming language is a Unix based programming language, and is sometimes considered as a pseudo-C interpreter. It is mainly used for sifting through and organizing large amounts of data at one time.


What is a interpret?

An interpreter is a computer program that executes the instructions written in a high level programming language. It can also preform the translation of a high level language to equivalent machine level code. But unlike compiler, an interpreter will compile the code line by line, i.e. each line will be translated to machine level language.


Is there any programming language that does not use compiler or interpreter?

Not really. You need some program to interpret your source code. There is the "assembler", but that can be thought of as a simpler version of a compiler - simpler, because the assembler basically just converts the source code instructions one-to-one to machine instructions.


How procedural oriented programming language is interdependency?

Function which uses other function as part of it programming is known as function interdependent


How does an interpreter translate high-level code to machine code?

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.


Is combination a library function in c language of programming?

No.


Does a high level programming language consist of English like instructions?

It varies from language to language, but usually yes.


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.