UnThreaded | Threaded | Whole Thread (31) | Ignore Thread Prev | Next
Author: tketola Big red star, 1000 posts Old School Fool Add to my Favorite Fools Ignore this person (you won't see their posts anymore) Number: of 190790  
Subject: Re: Yet another Java flaw Date: 10/3/2012 4:32 PM
Post New | Post Reply | Reply Later | Create Poll Report this Post | Recommend it!
Recommendations: 1
Hey Steven,,, you said:

Wrong on both counts.

A Java VM is a virtual machine, and it's ancestor in spirit is the Pascal p-machine and p-code. Programmers write apps in Java (or Pascal), compile that code to Java bytecode (or P-code), and execute that code on a Java VM (or P-machine).
Java uses a two step compilation process. Java source code is compiled down to "bytecode" by the Java compiler. The bytecode is executed by Java Virtual Machine (JVM). The current version of Sun HotSpot JVM uses a technique called Just-in-time (JIT) compilation to compile the bytecode to the native instructions understood by the CPU on the fly at run time.


Yes you are!!!

Regardless of how the Execution takes place, by Compilation or Interpretation, depends on the particular Machine and Implementation, the Tools Supported, etc. It can be and is done both ways, by Compilation or Interpretation, read below!!!

So, in my mind anyway, any initial Source-Code-Compilation that does NOT directly result in Executable/Loadable-Machine-Code, is still being Interpreted, one way or another.

Using JIT, JVM, Bytecode, etc., in any combination is still Interpretation, on the Fly or NOT.!!!

Just my opinion...

TK...
____________________________________________________

http://stackoverflow.com/questions/1326071/is-java-a-compile...

Java uses a two step compilation process. Java source code is compiled down to "bytecode" by the Java compiler. The bytecode is executed by Java Virtual Machine (JVM). The current version of Sun HotSpot JVM uses a technique called Just-in-time (JIT) compilation to compile the bytecode to the native instructions understood by the CPU on the fly at run time.

Some implementations of JVM might interpret the bytecode instead of JIT compiling it to machine code and running it directly. While this is still considered an "interpreter." It's significantly different from interpreters that read and execute the high level source code (i.e. in this case, Java source code is not interpreted directly, the bytecode, output of Java compiler, is.)

To summarize, depending on the execution environment, bytecode can be:

compiled ahead of time and executed as native code (similar to C++)
compiled just-in-time and executed
interpreted
directly executed by a supported processor (bytecode is the native instruction set of some CPUs)



And...

The terms "interpreted language" or "compiled language" don't make sense, because any programming language can be interpreted and/or compiled.

As for the existing implementations of Java, most involve a compilation step to bytecode, so they involve compilation. The runtime also can load bytecode dynamically, so some form of a bytecode interpreter is always needed. That interpreter may or may not in turn use compilation to native code internally.

These days partial just-in-time compilation is used for many languages which were once considered "interpreted", for example Javascript.


____________________________________________________
Post New | Post Reply | Reply Later | Create Poll Report this Post | Recommend it!
Print the post  
UnThreaded | Threaded | Whole Thread (31) | Ignore Thread Prev | Next

Announcements

Foolanthropy 2014!
By working with young, first-time moms, Nurse-Family Partnership is able to truly change lives – for generations to come.
When Life Gives You Lemons
We all have had hardships and made poor decisions. The important thing is how we respond and grow. Read the story of a Fool who started from nothing, and looks to gain everything.
Post of the Day:
Macro Economics

Economic Implications of Cuba
What was Your Dumbest Investment?
Share it with us -- and learn from others' stories of flubs.
Community Home
Speak Your Mind, Start Your Blog, Rate Your Stocks

Community Team Fools - who are those TMF's?
Contact Us
Contact Customer Service and other Fool departments here.
Work for Fools?
Winner of the Washingtonian great places to work, and "#1 Media Company to Work For" (BusinessInsider 2011)! Have access to all of TMF's online and email products for FREE, and be paid for your contributions to TMF! Click the link and start your Fool career.
Advertisement