The compiler working panel features an fully integrated development environment (IDE) that provides comprehensive facilities to programmers for GPC scripting development. It consists of a source code editor, syntax highlighting, integrated GPC compiler and a testing tools. The compiler translates a high-level GPC code into a very simple bytecode, that later is executed by the virtual machine of Titan One device. The GPC compilation process eliminates a number of costly operations that interpreter has to perform, which means an improvement of a factor of 10 in speed if compared with an regular interpreted language.
To compile a GPC script first open the script in the source code editor and then press F7 (or click on Compile icon), the Output area will show the compilation result, such as errors and warnings found in the source code, the bytecode size and the stack memory usage.
The compiler tab bar allows you to select between different opened GPC scripts. The first 9 GPC scripts in the tab bar receive a number, which correspond to the memory slot that the script will be stored in the Titan One device when running the command "Program Device". You can rearrange the order of GPC scripts in the tab bar by dragging and drop they. When you make changes in the source code an asterisk (*) will be displayed in the tab title, indicating the file was not saved yet.
The compile command, as its name implies, compiles the active GPC source code. It is primarily used to verify if the script has lexical or syntactical errors and warnings. The compile command can also be executed by the shortcut key F7.
The command "Build and Run" (shortcut key F5) compiles the active GPC source code and load its bytecode directly into device's RAM. The GPC VM will automatically run the loaded bytecode, so you can test your script on-the-fly and check all the inputs and outputs using the Device Monitor. You can set a configuration to automatically open the Device Monitor on the Gtuner options.
This command is only available when the Titan One device is connected to your computer by the PCPROC side port, through a USB cable.
The bytecode of a GPC script can be exported to a file. This feature is used by the Titan One team to publish Gamepacks and currently does not have a real application for the users.