IntrodunctionXPE is a very stright forward language similar in many respects to 'C'.
The main goal when designing and implementing XPE was that it should be familiar to 'C' programmers and be as forgiving and easy to use as possible.
XPE was not designed to be the fastest most efficient language ever produced. Its main purpose is to provide a translation mechanism between the user written application code and the IPAD-Pro core. It provides a means by which the application programmer can define what information should be exchanged between the GUI and application code, and how it is exchanged. XPE is to the IPAD-Pro core as SQL is to a database engine.
Where XPE differs from 'C':
- variables and functions are not typed (a variable can hold a string at one point in the program flow and a structure at another).
- only one statement per line is allowed (this makes tracing and single stepping much simpler and removes the need for a semicolon at the end of every statement).
- no pointers are allowed (the only thing that comes close is the structure and array reference - which allows structures and arrays to have shared and recursive components).
- structures are dynamically defined (members are added at runtime but this is completly transparent to the programmer).
- arrays are dynamic
- coercion between values is automatic and depends on the operator used
- The syntax of 'if', 'for' and 'while' statements has been made a little more verbose which should add clarity to the code produced
Advanced XPE features
- structures are dynamically defined so there is no need to recompile the entire system when a new member is added to a structure (third party libraries are not affected). Also a method can operate on more than one type of structure since the actual positions of the members (it operates on) within the structure is irrelivent.
- members of a structure can be looked up at runtime like an associative array.
- functions and methods can be called by string name, the names can be built at runtime to provide complex function lookup without the need to compile complex dynamic lookup tables containing external references to user supplied libraries
- generators are supported (these are special kinds of user written functions that can return a series of results one after the other as if read from another task communicating through a pipe)
- XPE has a concept of modules which are similar to C++ classes and allows use of the method and scope syntax of C++ to encapsulate data and functionality.
external function interface