|
June 22, 2000 WMLScript's Bytecode Tips: June 2000
Yehuda Shiran, Ph.D.
|
|
To fit the narrow bandwidth in wireless communication, both WML and WMLScript code are compiled into a bytecode on the server and then sent to the user agent. The bytecode is a binary representation of the text-based WML and WMLScript code. It is structured very similarly to binary executable files. It consists of instruction sets, opcodes, addresses, etc. The advantage of bytecode files over binary executable files is that it is machine independent. You compile it once and run on any machine capable of running WMLScript interpreter. From now on, when you hear the term compiled once - run everywhere, you'll know where it is coming from. Let's examine the bytecode of the mortgage example from Column 62. The size of mortgage.wml is 1071 bytes. Its bytecode's length is 446 bytes (more than 2x reduction in size). Here is the top portion of the bytecode:
This display can be generated only by an application that can interpret WMLScript. We used the Nokia WAP Toolkit for this. It supports two views: WML and bytecode. The above output is For more on WMLScript and bytecode, go to Column 62, WMLScript Primer.
People who read this tip also read these tips: Look for similar tips by subject: |
| ||||||||||||||||||||