Pike has its roots in LPC, which was a language developed for MUDs. Programmers at Lysator in Linköping, Sweden, most notably Fredrik Hübinette and Per Hedbor, separated the language and virtual machine from the rest of the MUD driver, and used it as a rapid prototyping language for various applications. LPC's license did not allow use for commercial purposes, and so a new GPL implementation was written in 1994, called µLPC (micro LPC). In 1996, µLPC was renamed to Pike in order to provide a more commercially viable name. Although the name of the company has changed over the years, the company now known as Roxen Internet Software employed many Pike developers, and provided resources for Pike's development. In 2002, the programming environment laboratory at Linköping University took over maintenance of Pike from Roxen. Several Pike programmers have found their way to the Linköping office of Opera Software, where the language plays a central role in the server/gateway parts of the Opera Mini application.
The third line tells the program in what state the main function exited
The last line lets the interpreter know that it has reached the end of the main function
The following list shows all the standard data types that Pike provides. Advanced data types such as sequences, queues, heaps, stacks, etc. are available in the ADT module which is included with Pike.
Basic data types:
program (the compiled representation of a class)
object (an instance of a class)
Pike requires explicit type definitions for all variables. It uses this information to report type errors at compile time. The following code will cause a compile error because the value of the variable "number" must be an integer but the code is attempting to assign floating point and string values to it.
That kind of behavior is traditionally considered restrictive and limiting by proponents of dynamically typed languages. However unlike C, C++, and Java, Pike uses a more flexible type system -- specifically, a system of tagged unions. The system allows programmers to declare variables that may contain values of multiple types, something impossible in most of the C-family languages without straying from the bounds of safe usage.
The following demonstrates a variable that can hold either an integer or a floating point number.
Because a variable can be declared as holding many different data types, functions are provided to determine what type of data is currently stored. These functions are all of the form typenamep, as in intp, floatp, stringp, etc.
Additionally, there is a special "mixed" data type. That definition allows a variable to hold any kind of data type.
In order to convert a value from one type to another, Pike can use an explicit cast: