Many VMs execute a language of binary form, knows as 'bytecode', which is assembled down from a human readable 'assembly' language.
For example the assembly instructions push 1 push 2 add
are translated (I think) to a series of ones and zeroes, which is then executed by the VM.
Why? Why don't VMs, and the JVM as an example, execute the assembly instructions directly?
They don't have the limitation of physical computers that can only handle ones and zeroes. The JVM can very well take textual instructions such as push 1 push 2
and execute them as they are. Why the additional step of compilation?
push 1 push 2
, it produces the "ones and zeros" right away.