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] | Partial, simulated with thunks [2] | Dynamic [3] | Yes [4] | Partial, with extension [5] | No [6] | Not applicable | Yes | 1984 |
Scheme | No [7] | Yes [8] | Dynamic [7] | Yes [9] | Partial, simulated with thunks [10] | No [11] | Not applicable | Yes | 1975 |
Racket | No | Yes, 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] | Not applicable | 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] | Partial, 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? ] | Partial, with extension [52] | Dynamic [53] | Partial, with extension [54] | Partial, with extension [55] | Partial [56] [57] | Not applicable | 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 | Partial, with the Stream module [66] | Dynamic | Yes | No | Yes | Not applicable | Yes | 2012 |
Erlang | No | No [67] | Dynamic | Yes [68] | No | Yes [69] | Not applicable | 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] | Partial, simulated with generators | Dynamic [74] | Yes [75] | No | Partial [76] | Not applicable | 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 | Partial, 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] | Not applicable | Yes | 2012 |
PureScript | Yes | No | Static | Yes | Yes | Yes | Yes | Yes | 2013 |
Rust | No | Partial, iterators are lazy, [82] external libraries exist [83] | Static [84] | Yes [85] | Yes [86] | Yes [87] | Yes, through traits [85] | No | 2010 |
Bosque | No | No | Static | Yes | Yes | Yes | Unknown | Yes | 2019 |
D | Yes, multiple levels of opt-in [88] [89] | Yes, but not default [90] | Static [91] | ? | Yes | Yes [92] | No | Yes [93] | 2001 |
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.
A compiled language is a programming language whose implementations are typically compilers, and not interpreters.
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.
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.
In computer science, future, promise, delay, and deferred refer to constructs used for synchronizing program execution in some concurrent programming languages. They describe an object that acts as a proxy for a result that is initially unknown, usually because the computation of its value is not yet complete.
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.
Clojure is a dynamic and functional dialect of the Lisp programming language on the Java platform.
In functional programming, a result type is a monadic type holding a returned value or an error code. They provide an elegant way of handling errors, without resorting to exception handling; when a function that may fail returns a result type, the programmer is forced to consider success or failure paths, before getting access to the expected result; this eliminates the possibility of an erroneous programmer assumption.
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)