Comparison of multi-paradigm programming languages
From HandWiki
Short description: none
Programming languages can be grouped by the number and types of paradigms supported.
Paradigm summaries
A concise reference for the programming paradigms listed in this article.
- Concurrent programming – have language constructs for concurrency, these may involve multi-threading, support for distributed computing, message passing, shared resources (including shared memory), or futures
- Actor programming – concurrent computation with actors that make local decisions in response to the environment (capable of selfish or competitive behaviour)
- Constraint programming – relations between variables are expressed as constraints (or constraint networks), directing allowable solutions (uses constraint satisfaction or simplex algorithm)
- Dataflow programming – forced recalculation of formulas when data values change (e.g. spreadsheets)
- Declarative programming – describes what computation should perform, without specifying detailed state changes c.f. imperative programming (functional and logic programming are major subgroups of declarative programming)
- Distributed programming – have support for multiple autonomous computers that communicate via computer networks
- Functional programming – uses evaluation of mathematical functions and avoids state and mutable data
- Generic programming – uses algorithms written in terms of to-be-specified-later types that are then instantiated as needed for specific types provided as parameters
- Imperative programming – explicit statements that change a program state
- Logic programming – uses explicit mathematical logic for programming
- Metaprogramming – writing programs that write or manipulate other programs (or themselves) as their data, or that do part of the work at compile time that would otherwise be done at runtime
- Template metaprogramming – metaprogramming methods in which a compiler uses templates to generate temporary source code, which is merged by the compiler with the rest of the source code and then compiled
- Reflective programming – metaprogramming methods in which a program modifies or extends itself
- Object-oriented programming – uses data structures consisting of data fields and methods together with their interactions (objects) to design programs
- Class-based – object-oriented programming in which inheritance is achieved by defining classes of objects, versus the objects themselves
- Prototype-based – object-oriented programming that avoids classes and implements inheritance via cloning of instances
- Pipeline programming – a simple syntax change to add syntax to nest function calls to language originally designed with none
- Rule-based programming – a network of rules of thumb that comprise a knowledge base and can be used for expert systems and problem deduction & resolution
- Visual programming – manipulating program elements graphically rather than by specifying them textually (e.g. Simulink); also termed diagrammatic programming[1]
Language overview
Language | Number of paradigms | Concurrent | Constraints | Dataflow | Declarative | Distributed | Functional | Metaprogramming | Generic | Imperative | Logic | Reflection | Objectoriented | Pipelines | Visual | Rule-based | Other paradigms |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Ada[2][3][4][5][6] | 5 | Yes[a 1] | No | No | No | Yes | No | No | Yes | Yes | No | No | Yes[a 2] | No | No | No | No |
ALF | 2 | No | No | No | No | No | Yes | No | No | No | Yes | No | No | No | No | No | No |
AmigaE | style="background:#F99;vertical-align:middle;text-align:center;" class="table-no"|No | No | No | No | No | No | No | No | Yes | No | No | Yes[a 2] | No | No | No | No | |
APL | 3 | No | No | No | No | No | Yes | No | No | Yes | No | No | No | No | No | No | Array (multi-dimensional) |
BETA[citation needed] | 3 | No | No | No | No | No | Yes | No | No | Yes | No | No | Yes[a 2] | No | No | No | No |
C++ | 7 (15) | Yes[7][8][9] | Library[10] | Library[11][12] | Library[13][14] | Library[15][16] | Yes | Yes[17] | Yes[a 3] | Yes | Library[18][19] | Library[20] | Yes[a 2] | Yes[21] | No | Library[22] | Array (multi-dimensional; using STL) |
C# | 6 (7) | Yes | No | Library[a 4] | No | No | Yes[a 5] | No | Yes | Yes | No | Yes | Yes[a 2] | No | No | No | reactive[a 6] |
ChucK | style="background:#9F9;vertical-align:middle;text-align:center;" class="table-yes"|Yes | No | No | No | No | No | No | No | Yes | No | No | Yes[a 2] | No | No | No | No | |
Claire | 2 | No | No | No | No | No | Yes | No | No | No | No | No | Yes[a 2] | No | No | No | No |
Clojure | 5 | Yes[23][24] | No | No | Yes | No | Yes[25] | Yes[26] | No | No | Library[27] | No | No | Yes[28] | Editor[29] | No | Multiple dispatch,[30] Agents[31] |
Common Lisp | 7 (14) | Library[32] | Library[33] | Library[34] | Yes[35] | Library[36] | Yes | Yes | Yes[37] | Yes | Library[38] | Yes | Yes (multiple dispatch, method combinations)[39][a 2] | Library[40] | Library[41] | Library[42] | Multiple dispatch, meta-OOP system,[43] Language is extensible via metaprogramming. |
Curl | 5 | No | No | No | No | No | Yes | No | Yes[a 3] | Yes | No | Yes | Yes[a 2] | No | No | No | No |
Curry | 4 | Yes | Yes | No | No | No | Yes | No | No | No | Yes | No | No | No | No | No | No |
D (version 2.0)[44][45] | 7 | Yes[a 7] | No | No | No | No | Yes | Yes[46][a 3] | Yes[a 3] | Yes | No | Yes | Yes[a 2] | No | No | No | No |
Delphi | 3 | No | No | No | No | No | No | No | Yes[a 3] | Yes | No | No | Yes[a 2] | No | No | No | No |
Dylan[citation needed] | 3 | No | No | No | No | No | Yes | No | No | No | No | Yes | Yes[a 2] | No | No | No | No |
E | 3 | Yes | No | No | No | Yes | No | No | No | No | No | No | Yes[a 2] | No | No | No | No |
ECMAScript[47][48] (ActionScript, E4X, JavaScript, JScript) | 4 (5) | partial (promises, native extensions)[a 8] | No | No | Library[49][50] | No | Yes | No | No | Yes | No | Yes | Yes[a 9] | Library[51][52] | Editor[53] | No | reactive,[a 10][54] event driven[a 11][a 12] |
Erlang | 3 | Yes | No | No | Yes | Yes | Yes | No | No | No | No | No | No | Yes | No | No | No |
Elixir | 4 | Yes | No | No | No | Yes | Yes | Yes | No | No | No | No | No | Yes | No | No | No |
Elm | 6 | Yes | No | Yes | Yes | No | Yes (pure)[a 13] | No | Yes | No | No | No | No | Yes | No | No | reactive |
F# | 7 (8) | Yes[a 7] | No | Library[a 4] | Yes | No | Yes | No | Yes | Yes | No | Yes | Yes[a 2] | No | No | No | reactive[a 6] |
Fortran | 4 (5) | Yes | No | No | No | No | Yes[a 13] | No | Yes[a 14] | No | No | No | Yes[a 2] | No | No | No | Array (multi-dimensional) |
Go | 4 | Yes | No | No | No | No | No | No | No | Yes | No | Yes | No | Yes | No | No | No |
Haskell | 8 (15) | Yes | Library[55] | Library[56] | Yes | Library[57] | Yes (lazy) (pure)[a 13] | Yes[58] | Yes | Yes | Library[59] | No | Immutable | Yes | Yes | Library[60] | literate, reactive, dependent types (partial) |
Io | 4 | Yes[a 7] | No | No | No | No | Yes | No | No | Yes | No | No | Yes[a 9] | No | No | No | No |
J[citation needed] | 3 | No | No | No | No | No | Yes | No | No | Yes | No | No | Yes[a 2] | No | No | No | No |
Java | 6 | Yes | Library[61] | Library[62] | No | No | Yes | No | Yes | Yes | No | Yes | Yes[a 2] | No | No | No | No |
Julia | 9 (17) | Yes | Library[63] | Library[64][65] | Library[66] | Yes | Yes (eager) | Yes | Yes | Yes | Library[67] | Yes | Yes (multiple dispatch, not traditional single) | Yes | No | Library[68][69] | Multiple dispatch, Array (multi-dimensional); optionally lazy[70] and reactive (with libraries) |
Kotlin | 8 | Yes | No | No | No | No | Yes | Yes | Yes | Yes | No | Yes | Yes | Yes | No | No | No |
LabVIEW | 4 | Yes | No | Yes | No | No | No | No | No | No | No | No | Yes | No | Yes | No | No |
Lava | 2 | No | No | No | No | No | No | No | No | No | No | No | Yes[a 2] | No | Yes | No | No |
LispWorks (version 6.0 with support for symmetric multi-processing, rules, logic (Prolog), CORBA) | 9 | Yes | No | No | No | Yes | Yes | Yes | No | Yes | Yes | Yes | Yes[a 2] | No | No | Yes | No |
Lua[citation needed] | 3 | No | No | No | No | No | Yes | No | No | Yes | No | No | Yes[a 9] | No | No | No | No |
MATLAB | 6 (10) | Toolbox[71] | Toolbox[72] | Yes[73] | No | Toolbox[74] | No | Yes[75] | Yes[76] | No | No | Yes[77] | Yes[78] | No | Yes[79] | No | Array (multi-dimensional) |
Nemerle | 7 | Yes | No | No | No | No | Yes | Yes | Yes | Yes | No | Yes | Yes[a 2] | No | No | No | No |
Object Pascal | 4 | Yes | No | No | No | No | Yes | No | No | Yes | No | No | Yes[a 2] | No | No | No | No |
OCaml | 4 | No | No | No | No | No | Yes | No | Yes | Yes | No | No | Yes[a 2] | No | No | No | No |
Oz | 11 | Yes | Yes | Yes | Yes | Yes | Yes | No | No | Yes | Yes | No | Yes[a 2] | Yes | No | Yes | No |
Perl | style="background:#9F9;vertical-align:middle;text-align:center;" class="table-yes"|Yes[80] | Library[81] | Yes[82] | No | No | Yes | Yes | No | Yes | No | Yes[a 2] | Yes[a 2] | Yes | No | No | No | |
PHP[83][84][85] | 4 | No | No | No | No | No | Yes | No | No | Yes | No | Yes | Yes[a 2] | No | No | No | No |
Poplog | 3 | No | No | No | No | No | Yes | No | No | Yes | Yes | No | No | No | No | No | No |
Prograph | 3 | No | No | Yes | No | No | No | No | No | No | No | No | Yes[a 2] | No | Yes | No | No |
Python | 5 (10) | Library[86][87] | Library[88] | No | No | Library[89] | Yes | Yes[90][91] | Yes[92][93] | Yes | Library[94] | Yes | Yes[a 2] | No | Editor[95] | No | structured |
R | 4 (6) | Library[96] | No | No | No | Library[97] | Yes | No | No | Yes | No | Yes | Yes | Yes[98] | No | No | Array (multi-dimensional) |
Racket | 10 | Yes[99] | Yes[100] | Yes[101] | No | Yes[102] | Yes | Yes | No | Yes | Yes | Yes | Yes | No | No | No | Lazy[103] |
Raku | 10 | Yes[104] | Yes[105] | Yes[106] | No | Library[107] | Yes | Yes[108] | Yes[109] | Yes | No | Yes[110] | Yes[111] | Yes | No | No | Multiple dispatch, lazy lists, reactive. |
ROOP | 3 | No | No | No | No | No | No | No | No | Yes | Yes | No | No | No | No | Yes | No |
Ruby | 5 | No | No | No | No | No | Yes | Yes | No | Yes | No | Yes | Yes[a 2] | No | No | No | No |
Rust (version 1.0.0-alpha) | 6 | Yes[a 7] | No | No | No | No | Yes | Yes[112][113] | Yes[114] | Yes | No | No | Yes | No | No | No | linear, affline, and ownership types |
Sather | style="background:#F99;vertical-align:middle;text-align:center;" class="table-no"|No | No | No | No | No | Yes | No | No | No | No | No | Yes[a 2] | No | No | No | No | |
Scala[115][116] | 9 | Yes[a 7] | No | Yes[a 15] | Yes | No | Yes | Yes | Yes | Yes | No | Yes | Yes[a 2] | No | No | No | No |
Simula | style="background:#F99;vertical-align:middle;text-align:center;" class="table-no"|No | No | No | No | No | No | No | No | Yes | No | No | Yes[a 2] | No | No | No | No | |
SISAL | 3 | Yes | No | Yes | No | No | Yes | No | No | No | No | No | No | No | No | No | No |
Spreadsheets | 2 | No | No | No | No | No | Yes | No | No | No | No | No | No | No | Yes | No | No |
Swift | 7 | Yes | No | No | No | No | Yes | Yes | Yes | Yes | No | Yes | Yes[a 2] | No | No | No | block-structured |
Tcl with Snit extension[citation needed] | 3 | No | No | No | No | No | Yes[117] | No | No | Yes | No | No | Yes[a 9][118] | No | No | No | No |
Visual Basic .NET | 6 (7) | Yes | No | Library[a 4] | No | No | Yes | No | Yes | Yes | No | Yes | Yes[a 2] | No | No | No | reactive[a 6] |
Windows PowerShell | 6 | No | No | No | No | No | Yes | No | Yes | Yes | No | Yes | Yes[a 2] | Yes | No | No | No |
Wolfram Language & Mathematica | 13[119] (14) | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes[120] | No | Yes | Knowledge Based |
See also
- Programming paradigm
- List of programming languages by type
- Domain-specific language
- Domain-specific multimodeling
Notes
- ↑ rendezvous and monitor-like based
- ↑ 2.00 2.01 2.02 2.03 2.04 2.05 2.06 2.07 2.08 2.09 2.10 2.11 2.12 2.13 2.14 2.15 2.16 2.17 2.18 2.19 2.20 2.21 2.22 2.23 2.24 2.25 2.26 2.27 2.28 2.29 2.30 2.31 2.32 2.33 2.34 Class-based
- ↑ 3.0 3.1 3.2 3.3 3.4 Template metaprogramming
- ↑ 4.0 4.1 4.2 using TPL Dataflow
- ↑ only lambda support (lazy functional programming)
- ↑ 6.0 6.1 6.2 using Reactive Extensions (Rx)
- ↑ 7.0 7.1 7.2 7.3 7.4 actor programming
- ↑ using Node.js' cluster module or child_process.fork method, web workers in the browser, etc.
- ↑ 9.0 9.1 9.2 9.3 Prototype-based
- ↑ using Reactive Extensions (RxJS)
- ↑ in Node.js via their events module
- ↑ in browsers via their native EventTarget API
- ↑ 13.0 13.1 13.2 purely functional
- ↑ parameterized classes
- ↑ Akka
Citations
- ↑ Bragg, S.D.; Driskill, C.G. (20–22 September 1994). "Diagrammatic-graphical programming languages and DoD-STD-2167A". Proceedings of AUTOTESTCON '94 (IEEEXplore). Institute of Electrical and Electronics Engineers (IEEE). pp. 211–220. doi:10.1109/AUTEST.1994.381508. ISBN 978-0-7803-1910-3.
- ↑ Ada Reference Manual, ISO/IEC 8652:2005(E) Ed. 3, Section 9: Tasks and Synchronization
- ↑ Ada Reference Manual, ISO/IEC 8652:2005(E) Ed. 3 Annex E: Distributed Systems
- ↑ Ada Reference Manual, ISO/IEC 8652:2005(E) Ed. 3, Section 12: Generic Units
- ↑ Ada Reference Manual, ISO/IEC 8652:2005(E) Ed. 3, Section 6: Subprograms
- ↑ Ada Reference Manual, ISO/IEC 8652:2005(E) Ed. 3, 3.9 Tagged Types and Type Extensions
- ↑ Thread support
- ↑ Atomics support
- ↑ Memory model
- ↑ Gecode
- ↑ SystemC
- ↑ Boost.Iostreams
- ↑ Boolinq
- ↑ "AraRat". https://www.cs.technion.ac.il/~lkeren/scp.pdf.
- ↑ OpenMPI
- ↑ Boost.MPI
- ↑ Boost.MPL
- ↑ LC++
- ↑ Castor
- ↑ Reflect Library
- ↑ N3534
- ↑ Boost.Spirit
- ↑ Clojure - Concurrent Programming
- ↑ Clojure - core.async
- ↑ Clojure - Functional Programming
- ↑ Clojure - Macros
- ↑ Clojure - core.logic
- ↑ Clojure - Threading Macros Guide
- ↑ "Light Table". 2019-04-08. http://lighttable.com/.
- ↑ Multimethods and Hierarchies
- ↑ Agents and Asynchronous Actions
- ↑ [1] many concurrency paradigms implemented as language extensions
- ↑ [2] constraint programming inside CL through extensions
- ↑ [3] dataflow extension
- ↑ [4] by creating DSLs using the built-in metaprogramming; also see note on functional, constraint and logic paradigms, which are part of declarative
- ↑ [5] MPI, etc via language extensions
- ↑ template metaprogramming using macros (see C++)
- ↑ [6] [7] [8] Prolog implemented as a language extension
- ↑ Common Lisp Object System see Wikipedia article on CLOS, the Common Lisp Object System.
- ↑ implemented by the user via a short macro, example of implementation
- ↑ - Visual programming tool based on Common Lisp
- ↑ [9] rule-based programming extension
- ↑ [10] through the Meta Object Protocol
- ↑ D Language Feature Table
- ↑ Phobos std.algorithm
- ↑ D language String Mixins
- ↑ The Little JavaScripter demonstrates fundamental commonality with Scheme, a functional language.
- ↑ Object-Oriented Programming in JavaScript gives an overview of object-oriented programming techniques in JavaScript.
- ↑ "React – A JavaScript library for building user interfaces". 2019-04-08. https://reactjs.org/.
- ↑ "TNG-Hooks". 2019-04-08. https://github.com/getify/tng-hooks.
- ↑ "Lodash documentation". 2019-04-08. https://lodash.com/docs/4.17.11#flow.
- ↑ "mori". 2019-04-08. https://swannodette.github.io/mori/#pipeline.
- ↑ "Light Table". 2019-04-08. http://lighttable.com/.
- ↑ "TNG-Hooks". 2019-04-08. https://github.com/getify/tng-hooks.
- ↑ "Prolog embedding". https://hackage.haskell.org/package/hswip.
- ↑ "Functional Reactive Programming". https://wiki.haskell.org/Functional_Reactive_Programming.
- ↑ Cloud Haskell
- ↑ "Template Haskell". https://wiki.haskell.org/Template_Haskell.
- ↑ "Logict: A backtracking logic-programming monad". https://hackage.haskell.org/package/logict.
- ↑ Kollmansberger, Steve; Erwig, Martin (30 May 2006). "Haskell Rules: Embedding Rule Systems in Haskell". https://web.engr.oregonstate.edu/~erwig/HaskellRules/HaskellRules_June06.pdf.
- ↑ https://jcp.org/en/jsr/detail?id=331 JSR 331: Constraint Programming API
- ↑ https://github.com/GoogleCloudPlatform/DataflowJavaSDK Google Cloud Platform Dataflow SDK
- ↑ "JuliaOpt/JuMP.jl". JuliaOpt. 11 February 2020. https://github.com/JuliaOpt/JuMP.jl.
- ↑ "GitHub - MikeInnes/DataFlow.jl". 2019-01-15. https://github.com/MikeInnes/DataFlow.jl.
- ↑ "GitHub - JuliaGizmos/Reactive.jl: Reactive programming primitives for Julia". 2018-12-28. https://github.com/JuliaGizmos/Reactive.jl.
- ↑ https://github.com/davidanthoff/Query.jl Query almost anything in julia
- ↑ https://github.com/lilinjn/LilKanren.jl A collection of Kanren implementations in Julia
- ↑ "GitHub - abeschneider/PEGParser.jl: PEG Parser for Julia". 2018-12-03. https://github.com/abeschneider/PEGParser.jl.
- ↑ "GitHub - gitfoxi/Parsimonious.jl: A PEG parser generator for Julia". 2017-08-03. https://github.com/gitfoxi/Parsimonious.jl.
- ↑ Lazy https://github.com/MikeInnes/Lazy.jl
- ↑ "Execute loop iterations in parallel". http://mathworks.com/help/distcomp/parfor.html.
- ↑ "Write Constraints". https://mathworks.com/help/optim/write-constraints.html.
- ↑ "Getting Started with SimEvents". https://mathworks.com/help/simevents/getting-started-with-simevents.html.
- ↑ "Execute loop iterations in parallel". http://mathworks.com/help/distcomp/parfor.html.
- ↑ "Execute MATLAB expression in text - MATLAB eval". https://mathworks.com/help/matlab/ref/eval.html.
- ↑ "Determine class of object". https://mathworks.com/help/matlab/ref/class.html.
- ↑ "Class Metadata". https://mathworks.com/help/matlab/get-information-about-classes-and-objects.html.
- ↑ "Object-Oriented Programming". https://mathworks.com/help/matlab/object-oriented-programming.html.
- ↑ "Simulink". https://mathworks.com/help/simulink/.
- ↑ interpreter based threads
- ↑ Moose
- ↑ Higher Order Perl
- ↑ PHP Manual, Chapter 17. Functions
- ↑ PHP Manual, Chapter 19. Classes and Objects (PHP 5)
- ↑ PHP Manual, Anonymous functions
- ↑ "Parallel Processing and Multiprocessing in Python". https://wiki.python.org/moin/ParallelProcessing.
- ↑ "threading — Higher-level threading interface". https://docs.python.org/2/library/threading.html.
- ↑ "python-constraint". https://pypi.python.org/pypi/python-constraint.
- ↑ "DistributedProgramming". https://wiki.python.org/moin/DistributedProgramming.
- ↑ "Chapter 9. Metaprogramming". http://chimera.labs.oreilly.com/books/1230000000393/ch09.html.
- ↑ "Metaprogramming". https://python-3-patterns-idioms-test.readthedocs.io/en/latest/Metaprogramming.html.
- ↑ "PEP 443 – Single-dispatch generic functions". https://www.python.org/dev/peps/pep-0443/.
- ↑ "PEP 484 – Type Hints". https://www.python.org/dev/peps/pep-0484/#generics.
- ↑ "PyDatalog". https://sites.google.com/site/pydatalog/.
- ↑ "Light Table". 2019-04-08. http://lighttable.com/.
- ↑ "Futureverse". https://www.futureverse.org/.
- ↑ "future batchtools". https://future.batchtools.futureverse.org/.
- ↑ "Magrittr: A Forward Pipe Operator for R". 17 November 2020. https://cran.r-project.org/package=magrittr.
- ↑ Racket Guide: Concurrency and Synchronization
- ↑ The Rosette Guide
- ↑ FrTime: A Language for Reactive Programs
- ↑ Racket Guide: Distributed Places
- ↑ Lazy Racket
- ↑ Channels and other mechanisms
- ↑ "Class Signature". https://docs.perl6.org/type/Signature#Type_Constraints.
- ↑ Feed operator
- ↑ https://github.com/perl6/doc/issues/1744#issuecomment-360565196 Cro module
- ↑ "Meta-programming: What, why and how". 2011-12-14. https://perl6advent.wordpress.com/2011/12/14/meta-programming-what-why-and-how/.
- ↑ https://perl6advent.wordpress.com/2009/12/18/day-18-roles/ Parametrized Roles
- ↑ "Meta-object protocol (MOP)". https://docs.perl6.org/language/mop.
- ↑ https://docs.perl6.org/language/classtut Classes and Roles
- ↑ "The Rust macros guide". http://doc.rust-lang.org/1.0.0-alpha/book/macros.html.
- ↑ "The Rust compiler plugins guide". http://doc.rust-lang.org/1.0.0-alpha/book/plugins.html.
- ↑ The Rust Reference §6.1.3.1
- ↑ An Overview of the Scala Programming Language
- ↑ Scala Language Specification
- ↑ "Tcl Programming/Introduction". https://en.wikibooks.org/wiki/Tcl_Programming/Introduction#One_language.2C_many_styles.
- ↑ "TCLLIB - Tcl Standard Library: snitfaq". http://tmml.sourceforge.net/doc/tcllib/snitfaq.html.
- ↑ Notes for Programming Language Experts, Wolfram Language Documentation.
- ↑ External Programs, Wolfram Language Documentation.
References
- Jim Coplien, Multiparadigm Design for C++, Addison-Wesley Professional, 1998.
Original source: https://en.wikipedia.org/wiki/Comparison of multi-paradigm programming languages.
Read more |