answersLogoWhite

0


Best Answer
Compilers and interpreters do similar jobs, but there are differences:


To run a program you've written, eg in JAVA, it must first be translated into machine code so the computer can read it. This is what compilers and interpreters do.

However, compilers convert the code all at once, save it, then run it; whereas interpreters translate the code one line at a time, as it is run.


Interpreters tend to result in faster translating of code so they are used mostly for debugging. This is because if you used a compiler, you'd have to re-compile your entire project every time you changed one little thing.

However, it's not very efficient to keep re-translating your code once you've finished writing it, because it would waste CPU time. Because of this, once code is done, it is normally compiled so that it runs faster and takes up less space. Another advantage of this is that your code is then much harder to copy without lengthy 'reverse engineering.'

User Avatar

Wiki User

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

Wiki User

13y ago

You have to have a compiler. What the compiler does is it takes the input file, and makes an output file read by what is called a linker. A linker is used to take all of those files generated by the compiler, and make one file e.g. A binary file....

This answer is:
User Avatar

User Avatar

Wiki User

11y ago

A traditional compiler translates source code into directly executable machine instructions at compile time, once and for all. At runtime, the computer executes these instructions at full speed.

Traditional interpreters translate the source code at runtime, thus resulting in slower (but in some ways more flexible) execution.

Modern designs often use hybrid schemes, often in the form of hypercode compilation combined with just-in-time compilation. In this approach, the compiler translates the source code into complex instructions for a hypothetical machine at compile-time. Once translated into this state, all syntax and semantic analysis is done, and need not burden the runtime system. At runtime, a compiling interpreter interprets and executes the instructions for the hypothetical machine once, generating a sequence of corresponding native machine instructions in the process. Subsequently repeated execution of the same sequence can then directly execute the native machine code at an overall speed comparable to that of a compiled application. Popular modern programming languages like Java or the .NET languages fall into this category of hybrid language designs.

This answer is:
User Avatar

User Avatar

Wiki User

13y ago

Compiler makes runtime faster.

Interpreter allows developing anywhere.

Compiler allows greater compatibility.

Compiler makes stuff look the same (E.g. Executable(compiled) will always look the same, whereas a web-page(interpreted) looks different depending on browser.

This answer is:
User Avatar

User Avatar

Wiki User

11y ago

An Interpreter translates the code line by line, this method can take a while but If there is an error in the code it can be edited without translating the whole code again. A Compiler on the other hand translates the whole code at once so if a line in the code needs to be edited, once edited, the whole code will need to be translated again.

Interpreters can be much slower than Compilers (depends on the size of the code). If you need to get the code translated fast then a compiler is the better option. If you want the code to be 100% error free, a Interpreter is probably better as its a lot easier and quicker to edit.

This answer is:
User Avatar

User Avatar

Wiki User

11y ago

From a pure perspective, compilers offer better execution performance at the cost of startup (compilation) time, while interpreters offer better startup time at the cost of performance. Compilers also tend to offer better error-detection capabilities but poorer debugging capabilities, while interpreters offer better debugging capabilities usually at the cost of error-detection capabilities; the specifics depend on the language being used. Later interpreters have started acting as compilers to offer better performance and improved syntax-error detection, but they are still considered inferior performance-wise to pure compiled languages. It should also be noted that compiled languages tend to be processor-specific (they cannot generally run on multiple types of processors without compilation for each processor type), while interpreted languages can run on any platform for which the interpreter has been ported to.

This answer is:
User Avatar

User Avatar

Wiki User

14y ago

Just pick a language, and you will know if it is interpreted, compiled, or something between the two (like Java).

This answer is:
User Avatar

User Avatar

Wiki User

13y ago

Apples and Pears.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What are the advantages of a a compiler over an interpreter b an interpreter over a compiler?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Which is type casting operator in java?

It means to explicitly convert to a certain type.double a = 5.0;int b;b = (int) a;The (int) is the explicit typecast in this case, but any type can be used, including a user-defined type (i.e., a class name). If you omit it, the compiler will complain, because when you convert a double to an int, precision may be lost. If you include it, you override this compiler check - you basically tell the compiler that you know what you are doing.It means to explicitly convert to a certain type.double a = 5.0;int b;b = (int) a;The (int) is the explicit typecast in this case, but any type can be used, including a user-defined type (i.e., a class name). If you omit it, the compiler will complain, because when you convert a double to an int, precision may be lost. If you include it, you override this compiler check - you basically tell the compiler that you know what you are doing.It means to explicitly convert to a certain type.double a = 5.0;int b;b = (int) a;The (int) is the explicit typecast in this case, but any type can be used, including a user-defined type (i.e., a class name). If you omit it, the compiler will complain, because when you convert a double to an int, precision may be lost. If you include it, you override this compiler check - you basically tell the compiler that you know what you are doing.It means to explicitly convert to a certain type.double a = 5.0;int b;b = (int) a;The (int) is the explicit typecast in this case, but any type can be used, including a user-defined type (i.e., a class name). If you omit it, the compiler will complain, because when you convert a double to an int, precision may be lost. If you include it, you override this compiler check - you basically tell the compiler that you know what you are doing.


Is qbasic a high level language?

The QBASIC program actually comes in 2 different flavors... A> QBASIC interpreter program: QBASIC Version 1.1 B> QBASIC compiler program: QBASIC 4.5/or, QB64/or, -etc. ...so, the answer is that this programming language comes in both forms: 'interpreter/compiler' versions; and, you have to select which of these you would prefer to download and use. *NOTE*: The compiler version of the language tends to be much larger; whereas, the interpreter version of the language tends to be small/very compact, indeed; thus, the interpreter tends to take up far less disk space. Many people start off their programming career by using QBASIC version 1.1 'interpreter' program; in order to learn 'how to' program. The interpreter version of the program can only create plain text (.bas) files; the which code CANNOT be shared with others; (not unless the persons who you are sharing this type of code with do already have a copy of the QBASIC interpreter program installed on their own computer). Then, later on, down the line...when they have become fully capable programmers themselves; they go and download a QBASIC 'compiler' program version, instead; which will allow them to go and create stand alone (.exe) program files that they can share with anybody. This is because (.exe) program files can RUN/execute entirely independently of the QBASIC program itself.


Advantages of prolog language?

8=====b <|>


Can you assign a char value to a variable of datatype of byte in java?

Not without casting. A char is a 16 bit type, whereas a byte is an 8 bit type. Therefore the compiler cannot guarantee that the 16 bit value will fit into the 8 bit value without overflowing. If you attempt to stick a char into a byte, you will get a compiler error. To override this, you can cast the char value to a byte during assignment. However, you might get some unexpected results. A few examples below: char a = 'A'; byte b = a; //compiler error char a = 'A'; byte b = (byte)a; //valid, no error. b=65 char a = 172; byte b = (byte)a; //valid, no error, but b=-84 because of overflow.


Lint is a compiler b a interactive debugger c a cinterpreter d a tool for analysing c plus plus program?

d a tool for analysing c plus plus program

Related questions

What are the advantages of reinvestment rate risk over interest rate risk?

B


Which is type casting operator in java?

It means to explicitly convert to a certain type.double a = 5.0;int b;b = (int) a;The (int) is the explicit typecast in this case, but any type can be used, including a user-defined type (i.e., a class name). If you omit it, the compiler will complain, because when you convert a double to an int, precision may be lost. If you include it, you override this compiler check - you basically tell the compiler that you know what you are doing.It means to explicitly convert to a certain type.double a = 5.0;int b;b = (int) a;The (int) is the explicit typecast in this case, but any type can be used, including a user-defined type (i.e., a class name). If you omit it, the compiler will complain, because when you convert a double to an int, precision may be lost. If you include it, you override this compiler check - you basically tell the compiler that you know what you are doing.It means to explicitly convert to a certain type.double a = 5.0;int b;b = (int) a;The (int) is the explicit typecast in this case, but any type can be used, including a user-defined type (i.e., a class name). If you omit it, the compiler will complain, because when you convert a double to an int, precision may be lost. If you include it, you override this compiler check - you basically tell the compiler that you know what you are doing.It means to explicitly convert to a certain type.double a = 5.0;int b;b = (int) a;The (int) is the explicit typecast in this case, but any type can be used, including a user-defined type (i.e., a class name). If you omit it, the compiler will complain, because when you convert a double to an int, precision may be lost. If you include it, you override this compiler check - you basically tell the compiler that you know what you are doing.


What is the a b c?

a is the first letter b is the 2nd letter c is the 3rd letter as well as compiler by which we can get a machine level language from a source programming


What is the advantages and dis advantages of in house studies?

kkkb b bbubnbh


Is qbasic a high level language?

The QBASIC program actually comes in 2 different flavors... A> QBASIC interpreter program: QBASIC Version 1.1 B> QBASIC compiler program: QBASIC 4.5/or, QB64/or, -etc. ...so, the answer is that this programming language comes in both forms: 'interpreter/compiler' versions; and, you have to select which of these you would prefer to download and use. *NOTE*: The compiler version of the language tends to be much larger; whereas, the interpreter version of the language tends to be small/very compact, indeed; thus, the interpreter tends to take up far less disk space. Many people start off their programming career by using QBASIC version 1.1 'interpreter' program; in order to learn 'how to' program. The interpreter version of the program can only create plain text (.bas) files; the which code CANNOT be shared with others; (not unless the persons who you are sharing this type of code with do already have a copy of the QBASIC interpreter program installed on their own computer). Then, later on, down the line...when they have become fully capable programmers themselves; they go and download a QBASIC 'compiler' program version, instead; which will allow them to go and create stand alone (.exe) program files that they can share with anybody. This is because (.exe) program files can RUN/execute entirely independently of the QBASIC program itself.


What has the author B P Buckles written?

B P. Buckles has written: 'A survey of compiler development aids' -- subject(s): Compiling (Electronic computers)


How do you solve a problem in compiler design?

prod=0; i=1; do { prod = prod +a[i] * b[i]; i=i+1; } while(i<=20);


What is the B shell use for in Linux?

A shell in Linux is the interpreter that provides a commandline interface (CLI). There are many kinds of shells.


Advantages of prolog language?

8=====b <|>


How many bytes are there for a plus b plus c?

It completely depends the datatype that you have assigned for the variables 'a' , 'b' , and 'c'. Check the compiler that you are using for the size of the datatype in bytes. Add them and thus you will get the answer.


What are the advantages and disadvantages to Jamaica of the holiday industry?

B


What has the author Mary Phelan written?

Mary Phelan has written: 'A. B. C. of the City of Man' 'The Interpreter's Resource (Topics in Translation, 19)'