Bytecode - Execution

Execution

A bytecode program may be executed by parsing and directly executing the instructions, one at a time. This kind of bytecode interpreter is very portable. Some systems, called dynamic translators, or "just-in-time" (JIT) compilers, translate bytecode into machine language as necessary at runtime: this makes the virtual machine unportable, but doesn't lose the portability of the bytecode itself. For example, Java and Smalltalk code is typically stored in bytecoded format, which is typically then JIT compiled to translate the bytecode to machine code before execution. This introduces a delay before a program is run, when bytecode is compiled to native machine code, but improves execution speed considerably compared to direct interpretation of the source code—normally by several magnitudes. Please note that bytecode as mandatory step for performance improvement is currently challenged, ex: Google's V8 and Dart VM do direct translation of source code to JITed machine code without bytecode intermediary.

Because of its performance advantage, today many language implementations execute a program in two phases, first compiling the source code into bytecode, and then passing the bytecode to the virtual machine. Therefore, there are virtual machines for Java, Python, PHP, Forth, and Tcl. The implementation of Perl and Ruby 1.8 instead work by walking an abstract syntax tree representation derived from the source code.

Read more about this topic:  Bytecode

Famous quotes containing the word execution:

    Some hours seem not to be occasion for any deed, but for resolves to draw breath in. We do not directly go about the execution of the purpose that thrills us, but shut our doors behind us and ramble with prepared mind, as if the half were already done. Our resolution is taking root or hold on the earth then, as seeds first send a shoot downward which is fed by their own albumen, ere they send one upward to the light.
    Henry David Thoreau (1817–1862)

    If Germany is to become a colonising power, all I say is, “God speed her!” She becomes our ally and partner in the execution of the great purposes of Providence for the advantage of mankind.
    —W.E. (William Ewart)

    My weakness has always been to prefer the large intention of an unskilful artist to the trivial intention of an accomplished one: in other words, I am more interested in the high ideas of a feeble executant than in the high execution of a feeble thinker.
    Thomas Hardy (1840–1928)