Pike programming language

Pike is a general-purpose, high-level, dynamic programming language, with a syntax similar to that of C. Unlike many other dynamic languages, pike is statically typed, and requires explicit type definitions. It features a flexible type system that allows the rapid development and flexible code of dynamically typed languages, while still providing the benefits of a statically typed language. Pike features garbage collection, advanced data types, and first-class anonymous functions, and supports many programming paradigms, including object-oriented, functional, aspect-oriented and imperative programming. Pike is free software, released under the GPL, LGPL and MPL licenses.

History

Pike has its roots in LPC, which was a language developed for MUDs . LPC's license did not allow use for commercial purposes, and so a new GPL implementation was written in 1994, called ųLPC. In 1996, ųLPC was renamed to pike 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 its development. In 2002, the programming environment laboratory at Linköping University took over maintenance of pike from Roxen.

Data types

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:

  • int
  • float
  • string

Container types:

  • array
  • mapping
  • multiset

Reference types:

  • program (the compiled representation of a class)
  • object (an instance of a class)
  • function

Pike requires explicit type definitions for all variables, and being a strongly typed language, uses this information to report type errors at compile time. The following code will produce a compiler error indicating that number must be an integer, and the code is attempting to assign floating point and string values to the integer variable.

int number;
number = 5.5;   // 5.5 is a floating point value
number = "5";   // "5" is a string, not the integer value 5

This behaviour is traditionally considered restrictive and limiting by proponents of dynamically typed language. However unlike C, C++ and Java, pike uses a flexible type system, allowing programmers to declare variables that may be any of a number of types. The following demonstrates a variable that can be either an integer or a floating point number.

int|float number;
number = 5;
number = 5.5;

Additionally, there is a special "mixed" data type definition that allows a variable to be any kind of data type. In order to convert a value from one type to another, it must be explicitly cast:

int number;
number = (int)"5.5";  // number is now the integer value 5

External links

de:Pike (Programmiersprache) pl:Pike sv:Pike

Navigation

  • Art and Cultures
    • Art (https://academickids.com/encyclopedia/index.php/Art)
    • Architecture (https://academickids.com/encyclopedia/index.php/Architecture)
    • Cultures (https://www.academickids.com/encyclopedia/index.php/Cultures)
    • Music (https://www.academickids.com/encyclopedia/index.php/Music)
    • Musical Instruments (http://academickids.com/encyclopedia/index.php/List_of_musical_instruments)
  • Biographies (http://www.academickids.com/encyclopedia/index.php/Biographies)
  • Clipart (http://www.academickids.com/encyclopedia/index.php/Clipart)
  • Geography (http://www.academickids.com/encyclopedia/index.php/Geography)
    • Countries of the World (http://www.academickids.com/encyclopedia/index.php/Countries)
    • Maps (http://www.academickids.com/encyclopedia/index.php/Maps)
    • Flags (http://www.academickids.com/encyclopedia/index.php/Flags)
    • Continents (http://www.academickids.com/encyclopedia/index.php/Continents)
  • History (http://www.academickids.com/encyclopedia/index.php/History)
    • Ancient Civilizations (http://www.academickids.com/encyclopedia/index.php/Ancient_Civilizations)
    • Industrial Revolution (http://www.academickids.com/encyclopedia/index.php/Industrial_Revolution)
    • Middle Ages (http://www.academickids.com/encyclopedia/index.php/Middle_Ages)
    • Prehistory (http://www.academickids.com/encyclopedia/index.php/Prehistory)
    • Renaissance (http://www.academickids.com/encyclopedia/index.php/Renaissance)
    • Timelines (http://www.academickids.com/encyclopedia/index.php/Timelines)
    • United States (http://www.academickids.com/encyclopedia/index.php/United_States)
    • Wars (http://www.academickids.com/encyclopedia/index.php/Wars)
    • World History (http://www.academickids.com/encyclopedia/index.php/History_of_the_world)
  • Human Body (http://www.academickids.com/encyclopedia/index.php/Human_Body)
  • Mathematics (http://www.academickids.com/encyclopedia/index.php/Mathematics)
  • Reference (http://www.academickids.com/encyclopedia/index.php/Reference)
  • Science (http://www.academickids.com/encyclopedia/index.php/Science)
    • Animals (http://www.academickids.com/encyclopedia/index.php/Animals)
    • Aviation (http://www.academickids.com/encyclopedia/index.php/Aviation)
    • Dinosaurs (http://www.academickids.com/encyclopedia/index.php/Dinosaurs)
    • Earth (http://www.academickids.com/encyclopedia/index.php/Earth)
    • Inventions (http://www.academickids.com/encyclopedia/index.php/Inventions)
    • Physical Science (http://www.academickids.com/encyclopedia/index.php/Physical_Science)
    • Plants (http://www.academickids.com/encyclopedia/index.php/Plants)
    • Scientists (http://www.academickids.com/encyclopedia/index.php/Scientists)
  • Social Studies (http://www.academickids.com/encyclopedia/index.php/Social_Studies)
    • Anthropology (http://www.academickids.com/encyclopedia/index.php/Anthropology)
    • Economics (http://www.academickids.com/encyclopedia/index.php/Economics)
    • Government (http://www.academickids.com/encyclopedia/index.php/Government)
    • Religion (http://www.academickids.com/encyclopedia/index.php/Religion)
    • Holidays (http://www.academickids.com/encyclopedia/index.php/Holidays)
  • Space and Astronomy
    • Solar System (http://www.academickids.com/encyclopedia/index.php/Solar_System)
    • Planets (http://www.academickids.com/encyclopedia/index.php/Planets)
  • Sports (http://www.academickids.com/encyclopedia/index.php/Sports)
  • Timelines (http://www.academickids.com/encyclopedia/index.php/Timelines)
  • Weather (http://www.academickids.com/encyclopedia/index.php/Weather)
  • US States (http://www.academickids.com/encyclopedia/index.php/US_States)

Information

  • Home Page (http://academickids.com/encyclopedia/index.php)
  • Contact Us (http://www.academickids.com/encyclopedia/index.php/Contactus)

  • Clip Art (http://classroomclipart.com)
Toolbox
Personal tools