The table shows a comparison of functional programming languages which compares various features and designs of different functional programming languages.
Name | Pure | Lazy evaluation | Typing | Abstract data types | Algebraic data types | Data is immutable | Type classes | Garbage collection | First appeared |
---|---|---|---|---|---|---|---|---|---|
Common Lisp | No [1] | Simulated with thunks [2] | Dynamic [3] | Yes [4] | Extension [5] | No [6] | ? | Yes | 1984 |
Scheme | No [7] | Yes [8] | Dynamic [7] | Yes [9] | Simulated with thunks [10] | No [11] | No | Yes | 1975 |
Racket | No | Default in Lazy Racket [12] | Dynamic by default, gradual with Typed Racket [13] | Yes [14] | Yes, with Algebraic Racket [15] | Partial [16] | No | Yes | 1995 |
Clojure | No [17] | Yes [18] | Dynamic [19] | Yes [20] | Yes [21] | Yes [22] | No | Yes | 2007 |
Standard ML | No [23] | No [24] [25] | Static [26] | Yes | Yes | Yes [27] | No | Yes | 1983 |
OCaml | No [28] | Yes [28] | Static [29] | Yes [30] | Yes [31] | Yes [32] | Simulated with parametric modules [33] | Yes | 1996 |
F# | No [34] | Yes [35] | Static [36] | Yes [37] | Yes [38] | Yes [39] | No | Yes | 2005 |
Haskell | Yes [40] | Default [41] | Static [42] | Yes [40] | Yes [43] | Yes [44] | Yes [45] | Yes | 1990 |
Scala | No [46] | Yes [47] | Static [46] | Yes [48] | Yes [48] | Yes [49] | Yes [50] | Yes | 2004 |
JavaScript | No [51] [ unreliable source? ] | Extension [52] | Dynamic [53] | Extension [54] | Extension [55] | Partial [56] [57] | ? | Yes | 1995 |
Clean | Yes [58] | Yes, with optional strictness annotations [59] | Static with uniqueness/optionally dynamic [60] | Yes [59] | Yes [59] | Yes, except for unique types [59] | Yes [59] | Yes | 1987 |
Miranda | Yes [61] | Default [62] | Static [61] | Yes [63] | Yes [61] | Yes | No | Yes | 1986 |
SASL | Yes [64] | Yes | Dynamic [65] | Yes | Yes | Yes | No | Yes | 1972 |
Elixir | No | Stream module [66] | Dynamic | Yes | No | Yes | ? | Yes | 2012 |
Erlang | No | No [67] | Dynamic | Yes [68] | No | Yes [69] | ? | Yes | 1986 |
Elm | Yes | No | Static [70] | ? | Yes [71] | Yes [70] | No | Yes | 2012 |
Futhark | Yes | No | Static [72] | Yes | Yes | Yes [70] | No | Yes | 2014 |
Python | No [73] | Simulated with generators | Dynamic [74] | Yes [75] | No | Partial [76] | ? | Yes | 1991 |
Idris | Yes [77] | Yes [77] | Static [77] | Yes [77] | Yes [77] | Yes [77] | Yes [77] | Yes | 2007 |
Nix | Yes | No | Static | No | Yes | Yes | No | Yes | 2003 |
Wolfram Language | No | No | Static | Yes | Yes | Yes | No | Yes | 1988 |
Kotlin | No | Lazy delegation [78] and Sequence [79] | Static | Yes | No | Yes | No | Yes | 2011 |
Swift | No | No | Static | Yes | Yes | Yes | No | Swift uses Automatic Reference Counting, which differs from tracing garbage collection but is designed to provide similar benefits with better performance. | 2014 |
Julia | No | No [80] | Dynamic [81] | Yes [81] | No | Partial [81] | ? | Yes | 2012 |
PureScript | Yes | No | Static | Yes | Yes | Yes | Yes | Yes | 2013 |
Rust | No | Lazy iterators [82] and external libraries [83] | Static [84] | Yes [85] | Yes [86] | Yes [87] | Yes, through traits [85] | No | 2010 |
Bosque | No | No | Static | Yes | Yes | Yes | ? | Yes | 2019 |
D | Optional [88] [89] | Optional [90] | Static [91] | ? | Yes | Yes [92] | No | Yes [93] | 2001 |
Gleam | No [94] | Experimental external libraries | Static | Yes | Yes | Yes | No | Yes | 2019 |
In computer science, functional programming is a programming paradigm where programs are constructed by applying and composing functions. It is a declarative programming paradigm in which function definitions are trees of expressions that map values to other values, rather than a sequence of imperative statements which update the running state of the program.
This is a "genealogy" of programming languages. Languages are categorized under the ancestor language with the strongest influence. Those ancestor languages are listed in alphabetic order. Any such categorization has a large arbitrary element, since programming languages often incorporate major ideas from multiple sources.
In object-oriented (OO) and functional programming, an immutable object is an object whose state cannot be modified after it is created. This is in contrast to a mutable object, which can be modified after it is created. In some cases, an object is considered immutable even if some internally used attributes change, but the object's state appears unchanging from an external point of view. For example, an object that uses memoization to cache the results of expensive computations could still be considered an immutable object.
Programming languages can be grouped by the number and types of paradigms supported.
In computer programming, an assignment statement sets and/or re-sets the value stored in the storage location(s) denoted by a variable name; in other words, it copies a value into the variable. In most imperative programming languages, the assignment statement is a fundamental construct.
Metaprogramming is a computer programming technique in which computer programs have the ability to treat other programs as their data. It means that a program can be designed to read, generate, analyse, or transform other programs, and even modify itself, while running. In some cases, this allows programmers to minimize the number of lines of code to express a solution, in turn reducing development time. It also allows programs more flexibility to efficiently handle new situations with no recompiling.
In computing, a persistent data structure or not ephemeral data structure is a data structure that always preserves the previous version of itself when it is modified. Such data structures are effectively immutable, as their operations do not (visibly) update the structure in-place, but instead always yield a new updated structure. The term was introduced in Driscoll, Sarnak, Sleator, and Tarjan's 1986 article.
An expression-oriented programming language is a programming language in which every construction is an expression and thus yields a value. The typical exceptions are macro definitions, preprocessor commands, and declarations, which expression-oriented languages often treat as statements.
In computer science, a tail call is a subroutine call performed as the final action of a procedure. If the target of a tail is the same subroutine, the subroutine is said to be tail recursive, which is a special case of direct recursion. Tail recursion is particularly useful, and is often easy to optimize in implementations.
Scala is a strong statically typed high-level general-purpose programming language that supports both object-oriented programming and functional programming. Designed to be concise, many of Scala's design decisions are intended to address criticisms of Java.
Programming languages are used for controlling the behavior of a machine. Like natural languages, programming languages follow rules for syntax and semantics.
A foreign function interface (FFI) is a mechanism by which a program written in one programming language can call routines or make use of services written or compiled in another one. An FFI is often used in contexts where calls are made into binary dynamic-link library.
QuickCheck is a software library, specifically a combinator library, originally written in the programming language Haskell, designed to assist in software testing by generating test cases for test suites – an approach known as property testing.
In functional programming, filter is a higher-order function that processes a data structure in some order to produce a new data structure containing exactly those elements of the original data structure for which a given predicate returns the boolean value true
.
A hash array mapped trie (HAMT) is an implementation of an associative array that combines the characteristics of a hash table and an array mapped trie. It is a refined version of the more general notion of a hash tree.
Clojure is a dynamic and functional dialect of the Lisp programming language on the Java platform.
Rosetta Code is a wiki-based programming chrestomathy website with implementations of common algorithms and solutions to various programming problems in many different programming languages. It is named for the Rosetta Stone, which has the same text inscribed on it in three languages, and thus allowed Egyptian hieroglyphs to be deciphered for the first time.
{{cite web}}
: CS1 maint: multiple names: authors list (link)