Comparison of functional programming languages
From HandWiki
Short description: none
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 | No[88] | Yes, but not default[89] | Static[90] | ? | Yes | Yes[91] | No | Yes[92] | 2001 |
References
- ↑ "LISP Introduction". http://www.math-cs.gordon.edu/courses/cps323/LISP/lisp.html.
- ↑ Antoniotti, Marco. "CLAZY: Lazy Calling in Common Lisp". http://common-lisp.net/project/clazy/.
- ↑ Tratt, Laurence (July 2009). "Dynamically Typed Languages". Advances in Computers 77: 149–184. doi:10.1016/s0065-2458(09)01205-4. http://tratt.net/laurie/research/pubs/html/tratt__dynamically_typed_languages/. Retrieved 26 November 2013.
- ↑ "LISP Tutorial Lecture 3: Data Abstraction". http://www.cs.sfu.ca/CourseCentral/310/pwfong/Lisp/3/tutorial3.html.
- ↑ "Algebraic data types in Common Lisp". https://github.com/stylewarning/cl-algebraic-data-type.
- ↑ "Mutable Data Structures". http://caml.inria.fr/pub/docs/fpcl/fpcl-07.pdf.
- ↑ 7.0 7.1 "Similar Functional Languages". http://caml.inria.fr/pub/docs/oreilly-book/html/book-ora202.html.
- ↑ "(Scheme) 17. Lazy Evaluation". http://www.shido.info/lisp/scheme_lazy_e.html.
- ↑ "Records - Revised6 Report on the Algorithmic Language Scheme". http://www.r6rs.org/final/html/r6rs-lib/r6rs-lib.html.
- ↑ "Algebraic Data Types in Scheme". https://pavpanchekha.com/blog/adtscm.html.
- ↑ "Programs with State". http://www.cs.uni.edu/~wallingf/teaching/cs3540/sessions/session26.html.
- ↑ Barzilay, Eli. "Lazy Racket". https://docs.racket-lang.org/lazy/index.html.
- ↑ Tobin-Hochstadt, Sam; St-Amour, Vincent; Dobson, Eric; Takikawa, Asumu. "Typed Racket". https://docs.racket-lang.org/ts-reference/index.html.
- ↑ "The Racket Guide: Programmer-Defined Datatypes". https://docs.racket-lang.org/guide/define-struct.html.
- ↑ Griffis, Eric. "Algebraic Racket". https://docs.racket-lang.org/algebraic/index.html.
- ↑ Buttrick, Matthew. "Beautiful Racket: Data Structures". https://beautifulracket.com/explainer/data-structures.html.
- ↑ "Clojure Functional Programing". http://clojure.org/functional_programming.
- ↑ "Clojure - lazy". http://clojure.org/lazy.
- ↑ "Exploring clojure: dynamic typing". 7 December 2012. http://tgoossens.wordpress.com/2012/12/07/dynamically-exploring-clojure/.
- ↑ Engelberg, Mark (21 April 2009). "Thoughts On Programming". http://programming-puzzler.blogspot.com/2009/04/adts-in-clojure.html.
- ↑ "clojure-contrib, typing example". https://code.google.com/p/clojure-contrib/source/browse/trunk/src/clojure/contrib/types/examples.clj?spec=svn596&r=596.
- ↑ "clojure: functional programming overview". http://clojure.org/functional_programming.
- ↑ "Introduction to Functional Programming". http://www.cl.cam.ac.uk/~jrh13/slides/funprog-jrh/l8.pdf.
- ↑ "Lazy and Eager Evaluation". http://homepages.inf.ed.ac.uk/dts/fps/lecture-notes/lazy.pdf.
- ↑ Harper, MacQueen, Milner. "Standard ML". Section 3.6. http://www.lfcs.inf.ed.ac.uk/reports/86/ECS-LFCS-86-2/ECS-LFCS-86-2.pdf.
- ↑ Wikibooks:Standard ML Programming/Types
- ↑ "Mutable and optional data". http://courses.cs.washington.edu/courses/cse341/04wi/lectures/08-ml-refs.html.
- ↑ 28.0 28.1 "Functional Programming – OCaml". http://ocaml.org/learn/tutorials/functional_programming.html.
- ↑ Hickey, Jason. "Introduction to Objective Caml". Section 2.4. Cambridge University Press. http://files.metaprl.org/doc/ocaml-book.pdf.
- ↑ "Type and exception definitions". http://caml.inria.fr/pub/docs/manual-ocaml-4.00/manual016.html.
- ↑ "Learn OCaml - Data Types". http://ocaml.org/learn/description.html#DataTypes.
- ↑ "Learn OCaml - Imperative Features". http://ocaml.org/learn/description.html#Imperativefeatures.
- ↑ "Implementing Type-Classes as OCaml Modules". https://accu.org/index.php/journals/2445.
- ↑ "Learning F#". http://fsharpforfunandprofit.com/learning-fsharp/.
- ↑ "Lazy Computations (F#)". Microsoft Developer Network. http://msdn.microsoft.com/en-us/library/vstudio/dd233247.aspx.
- ↑ "About F#". http://fsharp.org/about/index.html.
- ↑ "Structures - F#". https://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/structures.
- ↑ "Discriminated Unions". https://msdn.microsoft.com/en-us/library/dd233226.aspx.
- ↑ "The F# 3.0 Language Specification: 1.1.2 Making Data Simple". http://fsharp.org/about/files/spec.pdf.
- ↑ 40.0 40.1 "Haskell Wiki". http://www.haskell.org.
- ↑ "Haskell Wiki Lazy Evaluation". http://www.haskell.org/haskellwiki/Lazy_evaluation.
- ↑ "Haskell Typing". HaskellWiki. http://www.haskell.org/haskellwiki/Typing.
- ↑ "Haskell Wiki Abstract Data Type". http://www.haskell.org/haskellwiki/Abstract_data_type.
- ↑ "Haskell Wiki". http://www.haskell.org/haskellwiki/Functional_programming#Immutable_data.
- ↑ "Type Classes and Overloading". http://www.haskell.org/tutorial/classes.html.
- ↑ 46.0 46.1 "Scala Overview". http://www.scala-lang.org/old/sites/default/files/linuxsoft_archives/docu/files/ScalaOverview.pdf.
- ↑ "Scala by Example". http://www.scala-lang.org/docu/files/ScalaByExample.pdf.
- ↑ 48.0 48.1 "Scala Reference". http://www.scala-lang.org/files/archive/nightly/pdfs/ScalaReference.pdf.
- ↑ "Mutable and Immutable Collections". http://docs.scala-lang.org/overviews/collections/overview.html.
- ↑ "The Neophyte's Guide to Scala Part 12: Type Classes". http://danielwestheide.com/blog/2013/02/06/the-neophytes-guide-to-scala-part-12-type-classes.html.
- ↑ List of multi-paradigm programming languages#Language overview
- ↑ Tao, Dan. "Lazy.js". Dan Tao. http://danieltao.com/lazy.js/.
- ↑ "JavaScript Overview". Mozilla Developer Network. Mozilla Developer Network. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/JavaScript_Overview.
- ↑ Frank, Thomas. "Add some klass to JavaScript". thomasfrank.com. http://www.thomasfrank.se/klass.html.
- ↑ Faubion, Nathan. "ADT". NPM. Joyent, nodejitsu. https://npmjs.org/package/adt.
- ↑ Immutable object
- ↑ "Javascript Data structures". Mozilla Developer Network. Mozilla Developer Network. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures.
- ↑ "FAQ - Clean". http://clean.cs.ru.nl/FAQ.
- ↑ 59.0 59.1 59.2 59.3 59.4 Plasmeijer, Rinus; Van Eekelen, Marko; Van Groningen, John (December 2011). Clean Version 2.2 Language Report. Department of Software Technology, University of Nijmegen. http://clean.cs.ru.nl/download/doc/CleanLangRep.2.2.pdf. Retrieved 23 May 2018.
- ↑ "Clean". http://clean.cs.ru.nl/Clean.
- ↑ 61.0 61.1 61.2 "Miranda Official Website". http://miranda.org.uk/.
- ↑ "An Overview of Miranda". http://www.cs.kent.ac.uk/people/staff/dat/miranda/Overview.html#Lazy.
- ↑ "An Overview of Miranda". http://www.cs.kent.ac.uk/people/staff/dat/miranda/Overview.html#Abstract.
- ↑ Turner, D.A. "An Implementation of SASL". University of St. Andrews, Department of Computer Science Technical Report. TR/75/4.
- ↑ Kahn, Gilles; Bertot, Yves; Huet, Gérard; Lévy, Jean-Jacques; Plotkin, Gordon (2009-09-24). Kahn networks at the dawn of functional programming. ISBN 9780521518253. https://books.google.com/books?id=W2baKp7710sC&q=sasl+dynamic+typing&pg=PA128.
- ↑ "Stream - Elixir v.1.6.0". https://hexdocs.pm/elixir/Stream.html.
- ↑ "Erlang Reference Manual". http://www.erlang.org/doc/reference_manual/expressions.html#id76539.
- ↑ "Erlang Programming Language - Abstract Patterns". http://www.erlang.org/eeps/eep-0029.html.
- ↑ "Stack Overflow - How do I modify a record in erlang?". https://stackoverflow.com/questions/2715517/how-do-i-modify-a-record-in-erlang.
- ↑ 70.0 70.1 70.2 "Elm Blog - Interactive Programming". http://elm-lang.org/blog/Interactive-Programming.elm.
- ↑ "Elm Syntax - Algebraic Data Types". http://elm-lang.org/learn/Syntax.elm#algebraic-data-types.
- ↑ "Type Inference". https://futhark.readthedocs.io/en/latest/language-reference.html#type-inference.
- ↑ "Functional Programming in Python". https://docs.python.org/3/howto/functional.html.
- ↑ "What is Python?". https://docs.python.org/3/faq/general.html#what-is-python.
- ↑ "Abstract Data Types and Stacks". http://www.cs.utexas.edu/~byoung/cs313e/slides5-adt.pdf.
- ↑ Immutable object
- ↑ 77.0 77.1 77.2 77.3 77.4 77.5 77.6 "Idris Overview". http://www.idris-lang.org/.
- ↑ "Kotlin - Delegated Properties". https://kotlinlang.org/docs/reference/delegated-properties.html.
- ↑ "kotlin-stdlib - kotlin.sequences". https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.sequences/.
- ↑ "Noteworthy Differences from Other Languages - The Julia Language". https://docs.julialang.org/en/v1/manual/noteworthy-differences/.
- ↑ 81.0 81.1 81.2 "Types - The Julia Language". https://docs.julialang.org/en/v1/manual/types/.
- ↑ "The Rust Programming Language, Processing a Series of Items with Iterators". https://doc.rust-lang.org/book/ch13-02-iterators.html.
- ↑ "Rust crate 'lazy'". https://crates.io/crates/lazy.
- ↑ "The Rust Programming Language, Data Types". https://doc.rust-lang.org/book/ch03-02-data-types.html.
- ↑ 85.0 85.1 "The Rust Programming Language, Traits". https://doc.rust-lang.org/book/ch10-02-traits.html.
- ↑ "The Rust Programming Language, Enums". https://doc.rust-lang.org/book/ch06-00-enums.html.
- ↑ "The Rust Programming Language, Variables and Mutability". https://doc.rust-lang.org/book/ch03-01-variables-and-mutability.html.
- ↑ "D - A general-purpose systems and applications programming language". https://dlang.org/.
- ↑ "Laziness - Dlang Tour". https://tour.dlang.org/tour/en/basics/laziness.
- ↑ "Type System". https://dlang.org/spec/type.html.
- ↑ "Immutable - Dlang Tour". https://tour.dlang.org/tour/en/basics/immutability.
- ↑ "Garbage Collection". https://dlang.org/spec/garbage.html.
Original source: https://en.wikipedia.org/wiki/Comparison of functional programming languages.
Read more |