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.
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.
because the compiler convert whole of the sentence once into the machine langauge but the interpreter convert one by one
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.
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.
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.
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.
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.
A compiler or interpreter converts high-level programming languages into machine code that can be understood and executed by the computer's hardware.
compiler and interpreter used to convert high level language to machine level language .....compiler does dis job in atonce while interpreter does in step by step
That sounds like the description of an interpreter.
because the compiler convert whole of the sentence once into the machine langauge but the interpreter convert one by one
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.
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.
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
Both are use to convert high level languages into machine language
since computers can understand only binary or machine language, that is the language of 1's and 0's, all high level languages requires a translators. translators are of two types, one is compiler and another is interpreter. there is a quiet difference between both these translators. these translators convert the high level codes in to number of machine codes, so that it can be processed or runned by a computer easily.
high level language is converted to machine level language using a compiler or an interpreter