Jump to content

Pidgin code

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Mange01 (talk | contribs) at 06:47, 20 October 2006. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

In numerical computation, Pidgin code, for example Pidgin Algol (the orig of the concept), Pidgin Pascal and Pidgin C, refers to mathematical style pseudocode that can be understood by a wide range of mathematically trained people. It is a compact and often informal notation that blends syntax taken from a conventional programming language with mathematical notation, typically using set theory and matrix operations, and perhaps also natural language descriptions. Hence the name: the mixture is a programming language analogy to a pidgin in natural languages.

It is used as a way to describe algorithms where the control structure is made explicit at a rather high level of detail, while some data structures are still left at an abstract level, independent of any specific programming language.

Normally non-ascii typesetting is used for the mathematical equations, for example by means of TeX or MathML markup, or proprietory Formula editor formats.

Examples

These are examples of Wikipedia articles that contain mathematical style psudo code:

Machine interpration

An alternative to using informal pseudocode for documentation of algorithms is to use a formal mathematical programming language that resembles to pidgin code, where non-ascii mathematical notation is mixed with control structures. Then the code can be interpreted by a machine, and tested immediately.

Several formal specification languages include set theory notation. Examples are:

Some array programming languages include vectorized expressions and matrix operations as non-ascii formulas, mixed with conventional control structures. Examples are:

See also