Pico is a
programming language
A programming language is a system of notation for writing computer programs.
Programming languages are described in terms of their Syntax (programming languages), syntax (form) and semantics (computer science), semantics (meaning), usually def ...
developed at the Software Languages Lab at
Vrije Universiteit Brussel
The Vrije Universiteit Brussel (Dutch language, Dutch, ; lit. Free University of Brussels; abbreviated VUB) is a Dutch- and English-speaking research university in Brussels, Belgium. It has four campuses: Brussels Humanities, Science and Engine ...
, intended to be simple, powerful, extensible, and easy to read.
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 is the study of linguistic Meaning (philosophy), meaning. It examines what meaning is, how words get their meaning, and how the meaning of a complex expression depends on its parts. Part of this process involves the distinction betwee ...
.
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.
Language elements
De Meuter, Gonzalez, and D'Hondt describe the Pico syntax as being "two-tiered."
The first layer consists of simple rules for writing small programs in a
functional programming
In computer science, functional programming is a programming paradigm where programs are constructed by Function application, applying and Function composition (computer science), composing Function (computer science), functions. It is a declarat ...
style.
Comments
Comments are surrounded by
backquotes ("`").
Variables
Variables
Variable may refer to:
Computer science
* Variable (computer science), a symbolic name associated with a value and whose associated value may be changed
Mathematics
* Variable (mathematics), a symbol that represents a quantity in a mathemat ...
are dynamically
typed; Pico uses static
scope.
var: value
Functions
Functions, like everything in Pico, are
first-class object
In a given programming language design, a first-class citizen is an entity which supports all the operations generally available to other entities. These operations typically include being passed as an argument, returned from a function, and ass ...
s, meaning they can be assigned to variables and passed to and returned from functions. Also, there are no anonymous functions in Pico; functions must have a name.
For example, a function,
func
, with two parameters,
param1
and
param2
, can be defined as:
func(param1, param2): ...
Functions can be called with the following syntax:
func(arg1, arg2)
Operators
Operators can be used as prefix or infix in Pico:
+(5, 2)
5 + 2
Data types
Pico has the following types:
string
String or strings may refer to:
*String (structure), a long flexible structure made from threads twisted together, which is used to tie, bind, or hang other objects
Arts, entertainment, and media Films
* ''Strings'' (1991 film), a Canadian anim ...
,
integer
An integer is the number zero (0), a positive natural number (1, 2, 3, ...), or the negation of a positive natural number (−1, −2, −3, ...). The negations or additive inverses of the positive natural numbers are referred to as negative in ...
,
real and
tables.
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
In mathematical logic, the lambda calculus (also written as ''λ''-calculus) is a formal system for expressing computability, computation based on function Abstraction (computer science), abstraction and function application, application using var ...
).
Control structures
Conditional evaluation
Only the usual if statement is included
if(condition, then, else)
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
Implementations
Mac OS, Mac OS X
MacPicoXPico
Windows
''This version is buggy''
WinPico stable
Linux
TextPico for Linux
Cross-platform
sPico for DrScheme
References
External links
*
Software Languages LabDepartment of Computer Science at VUBVUBThe Infogroep Pico page
{{Lisp programming language
1997 software
Programming languages created in 1997
Programming languages
Functional languages
Educational programming languages
Academic programming languages
Dynamically typed programming languages
Lisp programming language family