Pico (programming language)

Last updated

Pico
Paradigms Reflective, procedural
Family Lisp
Designed by Theo D'Hondt
Wolfgang De Meuter
Developer Vrije Universiteit Brussel
First appeared1995;29 years ago (1995)
Stable release
2.0 / 2007;17 years ago (2007)
Implementation language Scheme
Platform IA-32, x86-64
OS Mac OS 9, macOS; LinuxBSD, Windows
Website pico.vub.ac.be
Influenced by
Scheme, Smalltalk

Pico is a programming language developed at the Software Languages Lab at Vrije Universiteit Brussel, intended to be simple, powerful, extensible, and easy to read. [1] The language was created to introduce the essentials of programming to non-computer science students.

Contents

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.

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." [1] The first layer consists of simple rules for writing small programs in a functional programming style.

Comments

Comments are surrounded by backquotes ("`").

Variables

Variables are dynamically typed; Pico uses static scope.

var: value

Functions

Functions, like everything in Pico, are first-class objects, 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. [1] 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, integer, 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).

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

Windows

Linux

Cross-platform

Related Research Articles

In computing, a compiler is a computer program that translates computer code written in one programming language into another language. The name "compiler" is primarily used for programs that translate source code from a high-level programming language to a low-level programming language to create an executable program.

<span class="mw-page-title-main">Computer program</span> Structure of a formal language

A computer program is a sequence or set of instructions in a programming language for a computer to execute. It is one component of software, which also includes documentation and other intangible components.

Mercury is a functional logic programming language made for real-world uses. The first version was developed at the University of Melbourne, Computer Science department, by Fergus Henderson, Thomas Conway, and Zoltan Somogyi, under Somogyi's supervision, and released on April 8, 1995.

<span class="mw-page-title-main">Scheme (programming language)</span> Dialect of Lisp

Scheme is a dialect of the Lisp family of programming languages. Scheme was created during the 1970s at the MIT Computer Science and Artificial Intelligence Laboratory and released by its developers, Guy L. Steele and Gerald Jay Sussman, via a series of memos now known as the Lambda Papers. It was the first dialect of Lisp to choose lexical scope and the first to require implementations to perform tail-call optimization, giving stronger support for functional programming and associated techniques such as recursive algorithms. It was also one of the first programming languages to support first-class continuations. It had a significant influence on the effort that led to the development of Common Lisp.

<span class="mw-page-title-main">Lua (programming language)</span> Lightweight programming language

Lua is a lightweight, high-level, multi-paradigm programming language designed primarily for embedded use in applications. Lua is cross-platform, since the interpreter of compiled bytecode is written in ANSI C, and Lua has a relatively simple C API to embed it into applications.

<span class="mw-page-title-main">Vrije Universiteit Brussel</span> University in Brussels, Belgium

The Vrije Universiteit Brussel is a Dutch and English-speaking research university located in Brussels, Belgium. It has four campuses: Brussels Humanities, Science and Engineering Campus, Brussels Health Campus, Brussels Technology Campus and Brussels Photonics Campus.

<span class="mw-page-title-main">Pointer (computer programming)</span> Object which stores memory addresses in a computer program

In computer science, a pointer is an object in many programming languages that stores a memory address. This can be that of another value located in computer memory, or in some cases, that of memory-mapped computer hardware. A pointer references a location in memory, and obtaining the value stored at that location is known as dereferencing the pointer. As an analogy, a page number in a book's index could be considered a pointer to the corresponding page; dereferencing such a pointer would be done by flipping to the page with the given page number and reading the text found on that page. The actual format and content of a pointer variable is dependent on the underlying computer architecture.

In computer programming, a function object is a construct allowing an object to be invoked or called as if it were an ordinary function, usually with the same syntax. In some languages, particularly C++, function objects are often called functors.

<span class="mw-page-title-main">ActionScript</span> Object-oriented programming language created for the Flash multimedia platform

ActionScript is an object-oriented programming language originally developed by Macromedia Inc.. It is influenced by HyperTalk, the scripting language for HyperCard. It is now an implementation of ECMAScript, though it originally arose as a sibling, both being influenced by HyperTalk. ActionScript code is usually converted to byte-code format by a compiler.

In computer science and mathematical logic, a function type is the type of a variable or parameter to which a function has or can be assigned, or an argument or result type of a higher-order function taking or returning a function.

In computer programming, the single-serving visitor pattern is a design pattern. Its intent is to optimise the implementation of a visitor that is allocated, used only once, and then deleted.

In computer programming, a callback or callback function is any reference to executable code that is passed as an argument to another piece of code; that code is expected to call back (execute) the callback function as part of its job. This execution may be immediate as in a synchronous callback, or it might happen at a later point in time as in an asynchronous callback. They are also called blocking and non-blocking.

TI-BASIC is the official name of a BASIC-like language built into Texas Instruments (TI)'s graphing calculators. TI-BASIC is a language family of three different and incompatible versions, released on different products:

In computer science, function composition is an act or mechanism to combine simple functions to build more complicated ones. Like the usual composition of functions in mathematics, the result of each function is passed as the argument of the next, and the result of the last one is the result of the whole.

Programming languages are used for controlling the behavior of a machine. Like natural languages, programming languages follow rules for syntax and semantics.

In computer programming, an anonymous function is a function definition that is not bound to an identifier. Anonymous functions are often arguments being passed to higher-order functions or used for constructing the result of a higher-order function that needs to return a function. If the function is only used once, or a limited number of times, an anonymous function may be syntactically lighter than using a named function. Anonymous functions are ubiquitous in functional programming languages and other languages with first-class functions, where they fulfil the same role for the function type as literals do for other data types.

AmbientTalk is an experimental object-oriented distributed programming language developed at the Programming Technology Laboratory at the Vrije Universiteit Brussel, Belgium. The language is primarily targeted at writing programs deployed in mobile ad hoc networks.

In mathematics and computer science, apply is a function that applies a function to arguments. It is central to programming languages derived from lambda calculus, such as LISP and Scheme, and also in functional languages. It has a role in the study of the denotational semantics of computer programs, because it is a continuous function on complete partial orders. Apply is also a continuous function in homotopy theory, and, indeed underpins the entire theory: it allows a homotopy deformation to be viewed as a continuous path in the space of functions. Likewise, valid mutations (refactorings) of computer programs can be seen as those that are "continuous" in the Scott topology.

Objective-C is a high-level general-purpose, object-oriented programming language that adds Smalltalk-style messaging to the C programming language. Originally developed by Brad Cox and Tom Love in the early 1980s, it was selected by NeXT for its NeXTSTEP operating system. Due to Apple macOS’s direct lineage from NeXTSTEP, Objective-C was the standard programming language used, supported, and promoted by Apple for developing macOS and iOS applications until the introduction of the Swift programming language in 2014.

<span class="mw-page-title-main">Nim (programming language)</span> Programming language

Nim is a general-purpose, multi-paradigm, statically typed, compiled high-level systems programming language, designed and developed by a team around Andreas Rumpf. Nim is designed to be "efficient, expressive, and elegant", supporting metaprogramming, functional, message passing, procedural, and object-oriented programming styles by providing several features such as compile time code generation, algebraic data types, a foreign function interface (FFI) with C, C++, Objective-C, and JavaScript, and supporting compiling to those same languages as intermediate representations.

References

  1. 1 2 3 D'Hondt, Theo; Gonzalez, Sebastian; De Meuter, Wolfgang (1 January 1999). "The design and rationale behind pico". Programming Technology Lab, Department of Computer Science, Vrije Universiteit Brussel. Retrieved 3 December 2023.