This is how the traditional Hello World program is coded in XPL0:
Text is a built-in routine that outputs a string of characters. The zero (0) tells where to send the string. In this case it is sent to the display screen, but it could just as easily be sent to a printer, a file, or out a serial port by using a different number.
In XPL0 all names must be declared before they can be used. The command word code associates the name Text to built-in routine number 12, which is the one that outputs strings. There are about a hundred of these built-in routines that provide capabilities such as input and output, graphics, and trig functions.
The 32-bit versions of the compilers automatically insert code declarations, thus the program above can simply be written as:
The TPK algorithm provides an example that can be compared to other languages:
Graphics has been a feature of XPL0 since its days on the Apple II computer.