You know, even "native" executables are "interpreted". After all, it is the CPU's job to translate opcodes into actual "operations" - that's interpretation, isn't it? Does it really matter what form the interpretation instructions come in?
Additionally, ocodes used in earlier architectures may be interpreted by the CPU as a sequence of "newer" opcodes (or 32-bit code on 64-bit systems). Then there is microcode. Is that hardware or software?
There are some hardware JVM. Is Java bytecode interpreted then?
Does the distinction matter?
Is Java compiled or interpreted?
Original post by ProgrammingHobbit
So its compiled (though not to native executable), then interpreted?quote]Yes to first part, no to second (in general). Methods that aren't called much are interpreted, but methods that are called often are compiled (during run-time) to native executable code and the native version is used thereafter.
I guess it all depends on how you define "interpreted" and "compiled". It seems like a semantics game to me.
ProgrammingHobbit
ProgrammingHobbit
I have to add your post to my list of dumbest things said on the internet, Hobbit. Thanks for expanding my list.
CPUs do not "interpret" machine code, they execute it. There's kinda a difference there. Please do yourself a favor and take some CS courses.
CPUs do not "interpret" machine code, they execute it. There's kinda a difference there. Please do yourself a favor and take some CS courses.
Quote:CPUs do not "interpret" machine code, they execute it. There's kinda a difference there.
Whats the difference between interpreting and executing? Take a transmeta CPU what does it do? A hardware JVM like the one at jopdesign.com?
Quote:Original post by boebi
I have to add your post to my list of dumbest things said on the internet, Hobbit. Thanks for expanding my list.
CPUs do not "interpret" machine code, they execute it. There's kinda a difference there. Please do yourself a favor and take some CS courses.
What did I say?
I made no attempt to define "interpreted" or "compiled" for anyone alse. I believe Fruny stated something to the effect that CPUs interpret machine code (no offense Fruny).
Don't go starting flames boebi. You know nothing about my CS knowledge and experience.
ProgrammingHobbit
Quote:Original post by FrunyIt does. By compiling you avoid one level of interpretation, and interpretation is costly. None of the interpretation happening in the lower levels matter, it's still one level *less* interpretation when the code is compiled. We could also have some term for by-passing two levels of interpretation, if that was ever practical. E.g. converting code directly to a new piece of hardware.
Does the distinction matter?
Interpreted code is not directly executed by the hardware...it gets "converted" during execution one instruction at a time (usually) to machine code. That process is much slower than running compiled code.
If you take Java bytecode and run it on a really old JVM, the bytecode is being interpreted. If you run the same code on a hardware JVM, the bytecode "magically" becomes compiled cause it's executing directly on the CPU...no runtime conversion.
If you take Java bytecode and run it on a really old JVM, the bytecode is being interpreted. If you run the same code on a hardware JVM, the bytecode "magically" becomes compiled cause it's executing directly on the CPU...no runtime conversion.
I believe Fruny said it all.
Basically, the java language is compiled to bytecode, and everyone seems to agree on this.
Then, every portion of bytecode is:
- Interpreted
- Compiled and interpreted
- Compiled and executed
- Executed
Depending on the VM implementation and the processor. It is interpreted on older VMs, executed on hardware VMs, compiled-executed on older machines and compiled-interpreted on current machines (where the processor interprets x86 machine code into its own set of instructions).
Also note that many recent CPUs do not execute x86 instructions: they actually execute their own internal set of instructions, and interpret (or compile) x86 code into these instructions on-the-fly.
Basically, the java language is compiled to bytecode, and everyone seems to agree on this.
Then, every portion of bytecode is:
- Interpreted
- Compiled and interpreted
- Compiled and executed
- Executed
Depending on the VM implementation and the processor. It is interpreted on older VMs, executed on hardware VMs, compiled-executed on older machines and compiled-interpreted on current machines (where the processor interprets x86 machine code into its own set of instructions).
Also note that many recent CPUs do not execute x86 instructions: they actually execute their own internal set of instructions, and interpret (or compile) x86 code into these instructions on-the-fly.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement