Comparison of functional programming languages

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[citation needed] | 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

## References

[edit]

1. ^ "LISP Introduction". Retrieved 26 November 2013.
2. ^ Antoniotti, Marco. "CLAZY: Lazy Calling in Common Lisp". Retrieved 26 November 2013.
3. ^ Tratt, Laurence (July 2009). "Dynamically Typed Languages". Advances in Computers. 77: 149–184\. doi:10.1016/s0065-2458(09)01205-4. Retrieved 26 November 2013.
4. ^ "LISP Tutorial Lecture 3: Data Abstraction".
5. ^ "Algebraic data types in Common Lisp". GitHub. Retrieved 11 May 2020.
6. ^ "Mutable Data Structures" (PDF). Retrieved 28 November 2013.
7. ^ a b "Similar Functional Languages". Retrieved 26 November 2013.
8. ^ "(Scheme) 17. Lazy Evaluation". Retrieved 30 April 2020.
9. ^ "Records - Revised6 Report on the Algorithmic Language Scheme". Retrieved 11 May 2020.
10. ^ "Algebraic Data Types in Scheme". Retrieved 11 May 2020.
11. ^ "Programs with State". Retrieved 29 November 2013.
12. ^ Barzilay, Eli. "Lazy Racket". Retrieved 8 February 2020.
13. ^ Tobin-Hochstadt, Sam; St-Amour, Vincent; Dobson, Eric; Takikawa, Asumu. "Typed Racket". Retrieved 8 February 2020.
14. ^ "The Racket Guide: Programmer-Defined Datatypes". Retrieved 8 February 2020.
15. ^ Griffis, Eric. "Algebraic Racket". Retrieved 8 February 2020.
16. ^ Buttrick, Matthew. "Beautiful Racket: Data Structures". Retrieved 8 February 2020.
17. ^ "Clojure Functional Programing".
18. ^ "Clojure - lazy". Retrieved 27 November 2013.
19. ^ "Exploring clojure: dynamic typing". 7 December 2012. Retrieved 26 November 2013.
20. ^ Engelberg, Mark (21 April 2009). "Thoughts On Programming". Retrieved 26 November 2013.
21. ^ "clojure-contrib, typing example". Retrieved 26 November 2013.
22. ^ "clojure: functional programming overview". Retrieved 26 November 2013.
23. ^ "Introduction to Functional Programming" (PDF). Retrieved 26 November 2013.
24. ^ "Lazy and Eager Evaluation" (PDF). Retrieved 26 November 2013.
25. ^ Harper, MacQueen, Milner. "Standard ML" (PDF). Section 3.6.`{{cite web}}`: CS1 maint: multiple names: authors list (link)
26. ^ Wikibooks:Standard ML Programming/Types
27. ^ "Mutable and optional data". Retrieved 28 November 2013.
28. ^ a b "Functional Programming – OCaml". Retrieved 26 November 2013.
29. ^ Hickey, Jason. "Introduction to Objective Caml" (PDF). Section 2.4. Cambridge University Press. Archived from the original (PDF) on 2 October 2013. Retrieved 26 November 2013.
30. ^ "Type and exception definitions".
31. ^ "Learn OCaml - Data Types".
32. ^ "Learn OCaml - Imperative Features".
33. ^ "Implementing Type-Classes as OCaml Modules". Retrieved 11 May 2020.
34. ^ "Learning F#". Retrieved 6 December 2013.
35. ^ "Lazy Computations (F#)". Microsoft Developer Network. Retrieved 26 November 2013.
36. ^ "About F#". Retrieved 26 November 2013.
37. ^ "Structures - F#". Retrieved 11 May 2020.
38. ^ "Discriminated Unions". 15 September 2021.
39. ^ "The F# 3.0 Language Specification: 1.1.2 Making Data Simple" (PDF). Retrieved 26 November 2013.
40. ^ a b "Haskell Wiki". Retrieved 26 November 2013.
41. ^ "Haskell Wiki Lazy Evaluation". Retrieved 26 November 2013.
42. ^ "Haskell Typing". HaskellWiki. Retrieved 26 November 2013.
43. ^ "Haskell Wiki Abstract Data Type". Retrieved 26 November 2013.
44. ^ "Haskell Wiki". Retrieved 27 November 2013.
45. ^ "Type Classes and Overloading".
46. ^ a b "Scala Overview" (PDF). Retrieved 26 November 2013.
47. ^ "Scala by Example" (PDF). Retrieved 26 November 2013.
48. ^ a b "Scala Reference" (PDF). Retrieved 26 November 2013.
49. ^ "Mutable and Immutable Collections". Retrieved 26 November 2013.
50. ^ "The Neophyte's Guide to Scala Part 12: Type Classes". Retrieved 29 November 2013.
51. ^ List of multi-paradigm programming languages#Language overview
52. ^ Tao, Dan. "Lazy.js". Dan Tao. Retrieved 26 November 2013.
53. ^ "JavaScript Overview". Mozilla Developer Network. Retrieved 26 November 2013.
54. ^ Frank, Thomas. "Add some klass to JavaScript". thomasfrank.com. Archived from the original on 8 December 2013. Retrieved 26 November 2013.
55. ^ Faubion, Nathan. "ADT". NPM. Joyent, nodejitsu. Retrieved 26 November 2013.
56. ^ Immutable object#JavaScript
57. ^ "Javascript Data structures". Mozilla Developer Network. Retrieved 26 November 2013.
58. ^ "FAQ - Clean".
59. ^ a b c d e Plasmeijer, Rinus; Van Eekelen, Marko; Van Groningen, John (December 2011). Clean Version 2.2 Language Report (PDF). Department of Software Technology, University of Nijmegen. Retrieved 23 May 2018.
60. ^ "Clean".
61. ^ a b c "Miranda Official Website".
62. ^ "An Overview of Miranda".
63. ^ "An Overview of Miranda".
64. ^ Turner, D.A. "An Implementation of SASL". University of St. Andrews, Department of Computer Science Technical Report. TR/75/4.
65. ^ Kahn, Gilles; Bertot, Yves; Huet, Gérard; Lévy, Jean-Jacques; Plotkin, Gordon (2009-09-24). Kahn networks at the dawn of functional programming. Cambridge University Press. ISBN 9780521518253.
66. ^ "Stream — Elixir v1.17.2".
67. ^ "Erlang Reference Manual". Retrieved 27 November 2013.
68. ^ "Erlang Programming Language - Abstract Patterns".
69. ^ "Stack Overflow - How do I modify a record in erlang?". Retrieved 15 December 2013.
70. ^ a b c "Elm Blog - Interactive Programming". Archived from the original on 6 October 2013. Retrieved 29 November 2013.
71. ^ "Elm Syntax - Algebraic Data Types". Archived from the original on 13 March 2016. Retrieved 29 November 2013.
72. ^ "Type Inference". Retrieved 24 July 2023.
73. ^ "Functional Programming in Python".
74. ^ "What is Python?".
75. ^ "Abstract Data Types and Stacks" (PDF).
76. ^ Immutable object#Python
77. ^ a b c d e f g "Idris Overview". Retrieved 6 December 2013.
78. ^ "Kotlin - Delegated Properties".
79. ^ "kotlin-stdlib - kotlin.sequences".
80. ^ "Noteworthy Differences from Other Languages - The Julia Language".
81. ^ a b c "Types - The Julia Language".
82. ^ "The Rust Programming Language, Processing a Series of Items with Iterators".
83. ^ "Rust crate 'lazy'".
84. ^ "The Rust Programming Language, Data Types".
85. ^ a b "The Rust Programming Language, Traits".
86. ^ "The Rust Programming Language, Enums".
87. ^ "The Rust Programming Language, Variables and Mutability".
88. ^ "D pure functions". Retrieved 3 February 2024.
89. ^ "D safe functions". Retrieved 3 February 2024.
90. ^ "Laziness - Dlang Tour". Retrieved 7 April 2020.
91. ^ "Type System". Retrieved 7 April 2020.
92. ^ "Immutable - Dlang Tour". Retrieved 7 April 2020.
93. ^ "Garbage Collection". Retrieved 7 April 2020.
94. ^ "Frequently asked questions – Gleam".