Pico programming language
Encyclopedia
See also Pico (disambiguation)
Pico (disambiguation)
- Places :Argentina* General Pico, a city in the Province of La Pampa* Río Pico , a village in the Province of ChubutBrazil* Pico da Neblina, a mountain in the State of Amazonas* Pico Paraná, a mountain in the State of ParanáCape Verde...

.

Pico is a programming language
Programming language
A programming language is an artificial language designed to communicate instructions to a machine, particularly a computer. Programming languages can be used to create programs that control the behavior of a machine and/or to express algorithms precisely....

 developed at the Software Languages Lab at Vrije Universiteit Brussel
Vrije Universiteit Brussel
The Vrije Universiteit Brussel is a Flemish university located in Brussels, Belgium. It has two campuses referred to as Etterbeek and Jette.The university's name is sometimes abbreviated by "VUB" or translated to "Free University of Brussels"...

. The language was created to introduce the essentials of programming to non-computer science students.

Pico can be seen as an effort to generate a palatable and enjoyable language for people who do not want to study hard for the elegance and power of a language. They have done it by adapting Scheme's semantics
Semantics
Semantics is the study of meaning. It focuses on the relation between signifiers, such as words, phrases, signs and symbols, and what they stand for, their denotata....

.

While designing Pico, the Software Languages Lab was inspired by the Abelson and Sussman's book "Structure and Interpretation of Computer Programs". Furthermore, they were influenced by the teaching of programming at high school or academic level.

Pico should be interpreted as 'small', the idea was to create a small language for educational purposes.

Variables

Variables
Variable (programming)
In computer programming, a variable is a symbolic name given to some known or unknown quantity or information, for the purpose of allowing the name to be used independently of the information it represents...

 are dynamically typed
Data type
In computer programming, a data type is a classification identifying one of various types of data, such as floating-point, integer, or Boolean, that determines the possible values for that type; the operations that can be done on values of that type; the meaning of the data; and the way values of...

; Pico uses static scope
Scope (programming)
In computer programming, scope is an enclosing context where values and expressions are associated. Various programming languages have various types of scopes. The type of scope determines what kind of entities it can contain and how it affects them—or semantics...

.
var: value

Functions

Functions are first-class object
First-class object
In programming language design, a first-class citizen , in the context of a particular programming language, is an entity that can be constructed at run-time, passed as a parameter, returned from a subroutine, or assigned into a variable...

s in Pico. They can be assigned to variables. For example a function with two parameters param1 and param2 can be defined as:
func(param1, param2): ...

Functions can be called with the following syntax:
func(arg1, arg2)

Data types

Pico has the following types: string
String (computer science)
In formal languages, which are used in mathematical logic and theoretical computer science, a string is a finite sequence of symbols that are chosen from a set or alphabet....

, integer
Integer
The integers are formed by the natural numbers together with the negatives of the non-zero natural numbers .They are known as Positive and Negative Integers respectively...

, real
Real number
In mathematics, a real number is a value that represents a quantity along a continuum, such as -5 , 4/3 , 8.6 , √2 and π...

 and tables
Array data type
In computer science, an array type is a data type that is meant to describe a collection of elements , each selected by one or more indices that can be computed at run time by the program. Such a collection is usually called an array variable, array value, or simply array...

.

It does not have a native char type, so users should resort to size 1 strings.

Tables are compound data structures that may contain any of the regular data types.

Boolean types are represented by functions (as in lambda calculus
Lambda calculus
In mathematical logic and computer science, lambda calculus, also written as λ-calculus, is a formal system for function definition, function application and recursion. The portion of lambda calculus relevant to computation is now called the untyped lambda calculus...

).

Code snippets

display('Hello World', eoln)

max(a, b):
if(a < b, b, a)

`http://www.paulgraham.com/accgen.html `
foo(n): fun(i): n := n+i

Mac OS, Mac OS X


Windows


External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK