functional_and_concurrent_programming_glossary

Functional and Concurrent Programming Glossary

Return to Functional and Concurrent Programming by Michel Charpentier, Functional and Concurrent Programming

action An impure subroutine that relies on side effects to modify the state of an application but does not return a (meaningful) value; sometimes also called a procedure. See also pure. Discussed in Chapter 3.

algebraic data type A type that combines existing types through a combination of alternatives (sum) and aggregation (product). Many standard types, including tuples, options, lists, and trees, can be defined as algebraic data types. Discussed in Chapter 5.

anonymous function See function literal.

argument An input to a function or method, such as a value or a type. Also called parameter.

asynchronous, asynchronously The opposite of synchronous, synchronously.

callback 1. A piece of code registered for (single, multiple, or optional) execution. Callbacks may run synchronously (as in Chapter 9) or asynchronously (as in Chapter 26). 2. The action of running such code.

CAS Compare-and-set.

class In object-oriented programming, a template for the creation of objects.

concurrent Said of multiple code executions that happen at the same time (“concurrently”). In this book, synonymous with parallel. Discussed in Chapter 16.

curried, currying A curried function consumes its first argument (or argument list) and returns another function that will use the remaining arguments (or argument lists). By currying, a function that uses a list of multiple arguments can be transformed into a function that uses multiple lists of fewer arguments. See also higher-order. Discussed in Section 9.2.

deadlock A situation is which several entities perpetually wait for each other in a cycle due to faulty synchronization. Discussed in Sections 22.3 and 27.7.

exception A disruption in the flow of program execution, typically caused by a failure and possibly handled by an exception handler. Exceptions are said to be thrown (or raised) and caught (or handled). Uncaught exceptions can cause a thread to terminate its execution.

execution stack A stack that keeps track of the current nesting of subroutines executed by a thread: Entering a subroutine adds to the stack, exiting it removes from the stack. Also called call stack.

expression A code fragment that, through computation, evaluates to a value. In addition to expressions, programming languages may involve code without a value, evaluated for the purpose of side effects.

extension method A mechanism by which additional methods can be grafted onto an existing type. Discussed in Section 2.5.

FIFO First-in, first-out.

function 1. A mathematical abstraction that maps each value from a set to a unique value from another set. 2. A programming language subroutine parameterized by zero or more arguments and which produces a value. For disambiguation, see pure, side effect. Discussed in Chapter 2.

function literal An expression that denotes an unnamed function; also called anonymous function. Lambda expressions are a common syntax for function literals. Discussed in Section 9.3.

functional Variously defined by different authors, but often said of a programming style that emphasizes the use of pure functions, immutability, recursion, algebraic data types, higher-order functions, and/or lazy evaluation. Discussed in Chapter 1.

future A handle on an asynchronous computation. Futures vary in capabilities, and terminology is ambiguous. Futures are sometimes referred to as promises. Discussed in Chapters 25 and 26.

garbage collection A form of automatic memory management used to reclaim unused memory. The Java Virtual Machine implements a garbage collector, available to all languages that run on this platform.

happens-before The partial order that defines the Java Memory Model. Note that “happens before” and “happens-before” have a different meaning in the book. Discussed in Section 22.5.

higher-order Said of a function that consumes or produces other functions as values. Discussed in Chapters 9 and 10.

immutable That which cannot be changed. This term can apply to an object state (immutable object) or a non-reassignable variable. See also mutable. Discussed in Chapter 3.

imperative Said of a programming style centered on actions that modify a state, such as assignment statements. By contrast, functional programming is said to be more declarative. See also pure, side effect.

infix Said of a notation in which an operator appears between its two arguments, as in x + y. See also prefix, postfix.

instance A member value of a type. In object-oriented programming specifically, an instance of a class — that is, an object created by instantiating this class.

JMM Java Memory Model.

JVM Java Virtual Machine.

lambda expression A common syntax for function literals, named after λ-`calculus, a theory of computable functions. Discussed in Section 9.3.

lazy Refers to various forms of delayed evaluation: lazy evaluation, lazy initialization, etc. Discussed in Chapter 12.

LIFO Last-in, first-out.

list 1. A generic term for an ordered collection of values, which can be mutable or not, support efficient access by indexing or not, etc. 2. A specific data structure used in functional programming, and characterized by its immutability and head/tail structure; sometimes referred to as functional list for disambiguation. Discussed in Section 3.7 and Chapter 7.

lock A basic synchronization mechanism used in concurrent programs to prevent data-sharing tasks from interfering with each other. Locks are only one of the many synchronizers a programming environment might offer. Discussed in Chapters 18 and 19 and Section 23.1.

method A function-like subroutine that is associated with a target object, which serves as one of its arguments.

mutable That can be changed. For instance, a mutable object has a state that can be modified; a mutable variable can be reassigned with a new value. See also immutable. Discussed in Chapter 3.

node In a graph, a vertex.

object The fundamental component of the state of an object-oriented program. An object typically encapsulates data and the operations that manipulate this data.

operator A function typically of one or two arguments, often with a symbolic name, and invoked in prefix, infix, or postfix notation.

option Used to represent a value that may or may not exist. An option either is empty or contains exactly one value. Options are often used as the return type of functions that do not always have a valid value to return. Discussed in Section 5.3.

parallel - Said of multiple code executions that happen at the same time (“in parallel”). In this book, synonymous with concurrent. Discussed in Chapter 16.

pattern matching - A construct, common in functional programming languages, that is used to select between alternatives and to separate components of an aggregate type. Pattern matching can be thought of as a powerful generalization of switch. It is especially handy when dealing with algebraic data types. Discussed in Chapter 5.

pattern-zipper - An efficient implementation technique for an immutable structure that is traversable (navigatable). Discussed in Section 5.6.

postfix - Said of a notation in which an operator follows its arguments, as in x++. See also infix, prefix.

prefix - Said of a notation in which an operator precedes its arguments, as in ++x. See also infix, postfix.

promise 1. A generator of a future. 2. Another name for a future. Discussed in Section 25.5.

pure - Said of a programming function whose behavior depends only on its input, and which has no side effects. Pure functions are used to represent true functions (mathematical functions). See also action. Discussed in Chapter 3.

queue 1. A data structure for temporary storage of values waiting to be processed. Queue elements are often retrieved in a predefined ordering. Common orderings are first-in-first-out (FIFO), last-in-first-out (LIFO), priority based, or time based. 2. A first-in, first-out queue.

recursion - See recursive.

recursive - Said of a function that invokes itself in its computation, one or more times, directly or indirectly, and of a programming style that relies on such functions. Discussed in Chapter 6.

runtime During code execution, the period in contrast to compile time — when code is compiled.

scope The fragment of a program in which a particular definition is operative. A defined entity (variable, function, class, etc.) can be used only within its scope.

set 1. A mathematical abstraction of an unordered collection of values, without duplicates. 2. A data structure that implements this abstraction, usually with efficient lookup, and possibly with ordering (ordered sets) or duplicates (multisets).

side effect A modification of the state of system. Could be intentional or not. See also pure, action. Discussed in Chapter 3.

stack 1. A data structure that stacks elements on top of each other, typically with only the top element accessible. Sometimes referred to as a last-in-first-out (LIFO) queue. 2. The execution stack.

stream A sequence whose values are created over time. A stream can potentially be endless. Discussed in Chapter 12.

switch A programming language construct used to pick among several alternatives. It can be seen as a generalization of if-then-else, which is basically a switch with two branches. See also pattern matching.

synchronization A generic term for mechanisms and techniques used by threads to coordinate. Discussed in Chapters 22 and 23.

synchronous, synchronously In this book, refers to a computation that takes place within the program flow (“now”), as opposed to an asynchronous computation that does not interfere with the current flow of execution. Discussed in Chapter 16.

tail recursion A particular form of recursion susceptible to compiler optimizations. Discussed in Section 6.5.

thread Short for thread of execution. A thread represents the execution (or run) of a program. A running program contains at least one thread, but programs can also be multithreaded. Discussed in Chapter 16.

tree A connected, acyclic graph, typically undirected. A rooted tree identifies a vertex as the root of the tree; an ordered tree maintains an ordering among the children of a node (e.g., left and right in a binary tree).

tuple An ordered aggregate of several values, possibly of different types. A 2-tuple is referred to as a pair; a 3-tuple as a triple.

type An abstract characterization of possible values. Variables, expressions, and function input and output can all have types that cons[[train the actual values they might take. Types also often cons[[train the operations that are available on values of that type. Discussed in Chapter 15.

value An immutable piece of data. Values can be stored in variables and data structures, returned by functions, or passed as arguments to functions.

varargs Short for variable-length arguments. Said of subroutines in which the number of arguments is not fixed. Discussed in Section 2.7.

variable A named reference, valid within a scope. The concept is more subtle than it sounds: Variables can refer to data or to code, and some variables can have their contents updated while others cannot. Discussed in Chapters 3 and 9.


© 1994 - 2024 Cloud Monk Losang Jinpa or Fair Use. Disclaimers

SYI LU SENG E MU CHYWE YE. NAN. WEI LA YE. WEI LA YE. SA WA HE.


functional_and_concurrent_programming_glossary.txt · Last modified: 2024/04/28 03:47 (external edit)