Google
 
   
Login
Username:

Password:


Lost Password?

Register now!
Search
Main Menu
top books
Polls
What do you think about php-deluxe.net?
Excellent!
Cool
Hmm..not bad
What the hell is this?
encyclopedia
recommendation
Freenet DSL
Who's Online
11 user(s) are online (10 user(s) are browsing encyclopedia)

Members: 0
Guests: 11

more...
browser tip
recommendation!
Sponsored
partner

Pike programming language

Pike is a general-purpose, high-level, dynamic programming language, with a syntax similar to that of C programming language. 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 (computer science), advanced data types, and first-class anonymous functions, and supports many programming paradigms, including object-oriented programming, functional programming, aspect-oriented programming and imperative programming. Pike is free software, released under the GPL, LGPL and Mozilla Public License licenses.

= History =

Pike has its roots in LPC programming language, 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.

    mixed number; number = 5; // number is now the integer value 5 number = 5.5; // number is now the float value 5.5 number = 5 ; // number is now the string value 5

    In order to convert a value from one type to another, it can be explicitly cast:

    mixed number; number = (int)5; // number is now the integer value 5 number = (string)number; // number is now the string value 5

    = External links =

  • [http://pike.ida.liu.se/ Official homepage]
  • [http://www.gotpike.org/ Community Page]