English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

What is the difference between a compiler and an interpreter?

Is Java a compiled or interpreted programming language?

Why are programs written in Java regarded running slower than those written in C++?

2007-10-31 00:31:13 · 3 answers · asked by Anonymous in Computers & Internet Software

3 answers

There is no such thing as an (interpreted language) or (compiled language)

Please have a look at :
http://en.wikipedia.org/wiki/Interpreter_(computing)
hope it clears your concept...

and the reason why Java run slower may be because its running on virtual machine (VM), depends what OS you using.

2007-10-31 00:41:45 · answer #1 · answered by Kash 2 · 0 0

In simple terms, an Interpreter is a program that follows the command set of written code. A compiler attempts to build native code for the machine to run on from that set of written code.

Whoa, there are interpreters and compilers for Java. You really have to specify which one. Are you really talking about Javascript; which is an interpreter based code for websites. Don't confuse it with Java, the language.

If your Java is an interpreter, then it would be slower than C++. That is because it would be "compiling code" while it runs.

Take SQL, for instance. Obviously, it is an interpreter. But when you execute SQL code to your SQL engine, it's really fast. You see, that SQL engine is already running on your database. When SQL is applied to it; the query is run at extreme speeds. Probably much faster than specialed C++ code.

Back in the late 80s, I was a part of two teams that were developing code. One, using the assembly language; and another with an advanced compiler. The assembly language team developed some really fast code. The compiler was not delivered to the second team for some time; giving the first team a head start. But their code was developed just in time at the end of the project. In comparison tests; the compiler ran faster, developed quicker and was easier to debug.

Good luck and Happy Computing!

2007-10-31 00:43:15 · answer #2 · answered by Anonymous · 0 0

There are few purely compiled language, although purely interpreted are still around.

Java as a programming language is compiled but as an application virtual machine platform it is interpreted as emulators are interpretation of non-native codes.

Slower because the actual virtual machine is interpreted but C++ is that few purely compiled one.

2007-10-31 00:52:53 · answer #3 · answered by Andy T 7 · 0 0

fedest.com, questions and answers