In order to execute (run) your sheerpower code, a number of steps are taken:
- Your source code file is read line-by-line.
- Lines that begin with a percent-sign (%) are processed right
away. These are called preprocessing directives. During this step:
- Additional files, known as include files, are read
line-by-line and merged into your code.
- Macros are expanded, and blueprints are generated.
- If you are deploying your code, deployment directives are also processed.
- Each line of source code is analyzed and compiled into
byte-code. Any constant expressions are also folded into the byte-code.
For example,
100*50
becomes 5000
- After compiling all source code into byte-code, a
"back patcher" phase is run to:
- Connect loops, calling routines, their start and end points, etc.
- Verify all variables are used correctly, among other
tasks.
- The byte-code is then executed by a "virtual machine."
- As it runs, the virtual machine uses a hinting system to
understand your code and optimize it for better performance.
Note:
A virtual machine (VM) is a software-based environment that simulates a physical
computer, allowing programs to run independently of the underlying hardware. In
Sheerpower, the VM interprets and executes byte-code, providing a layer that
translates your code into machine actions. This setup ensures portability, stability,
and efficient performance by managing resources and optimizing tasks as your code runs.
Summary:
Sheerpower's execution process carefully prepares and
optimizes your code, ensuring both accuracy and efficiency. From reading and
merging include files to compiling and running byte-code, each step is designed to
enhance your program's performance. The virtual machine's hinting system
further fine-tunes execution, making Sheerpower ideal for applications requiring robust,
efficient handling of complex logic. With a solid understanding of this process,
you'll be better equipped to
develop and optimize Sheerpower applications confidently.