How do languages/runtimes based on JVM generate Java bytecode?

Some of them generate bytecode. Some have a runtime system that executes as an interpreter. Some have a blend of the two.

The JVM is, after all, a CPU (which just happens to not really exist) with a certain architecture and a certain set of instructions. You target it with your code generator the same way you generate object code for any CPU. (Now to be fair its instruction set is very heavily focused on Java's capabilities and needs, but it's still general enough to support other models.Barely.).

Some of them generate bytecode. Some have a runtime system that executes as an interpreter. Some have a blend of the two.

The JVM is, after all, a CPU (which just happens to not really exist) with a certain architecture and a certain set of instructions. You target it with your code generator the same way you generate object code for any CPU. (Now to be fair its instruction set is very heavily focused on Java's capabilities and needs, but it's still general enough to support other models.Barely.) There are a variety of ways to generate JVM byte-code.

You can handroll your own . Class file generation routines (since the format and the instruction set is well-specified). You can use a number of libraries like ASM or BCEL (which is the most common approach, I think).

Or you could generate Java code as your intermediate representation and then compile that with the usual Java tools. You execute the code the same way you execute Java-compiled code: the Java runtime loads the generated . Class files and starts running.

This is all part of the specification as well.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions