Original Post
🔒 Locked
How does bytecode work?
Advertisement
Each ''ascii statement'' is turned into a sequence of basic operations, each assigned a binary representation (bytecode).
Then you can have
a) a code tile-based compiler matching actual executable code to known ''tiles'' of bytecode.
b) a big switch statement (basically bytecode tiles of size 1) acting on the stream of bytecode.
c) other similar techniques
“Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.” — Brian W. Kernighan (C programming language co-inventor)
Then you can have
a) a code tile-based compiler matching actual executable code to known ''tiles'' of bytecode.
b) a big switch statement (basically bytecode tiles of size 1) acting on the stream of bytecode.
c) other similar techniques
“Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.” — Brian W. Kernighan (C programming language co-inventor)
Picture it this way, if you want...
A text file containing instructions and data contains instructions and expressions of variable length. Unpredictable by the interpreter. It has to check multiple bytes against a wide variety of multiple-byte values, and it has to do lots of conversion.
A binary file containing instructions and data contains instructions and data of predictable and fixed length. A single byte or word need only be checked against a variety of same-length values, or it could even be used as a simple index into an array of operation functions. Values are already in binary format, ready to be used by the computer without converting them from text. And complicated math or logic expressions are already broken down and optimized into individual small steps, easily executed without further thought.
A text file containing instructions and data contains instructions and expressions of variable length. Unpredictable by the interpreter. It has to check multiple bytes against a wide variety of multiple-byte values, and it has to do lots of conversion.
A binary file containing instructions and data contains instructions and data of predictable and fixed length. A single byte or word need only be checked against a variety of same-length values, or it could even be used as a simple index into an array of operation functions. Values are already in binary format, ready to be used by the computer without converting them from text. And complicated math or logic expressions are already broken down and optimized into individual small steps, easily executed without further thought.
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement