Comparison of multi-paradigm programming languages

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 behavior)
  • 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 a computation should perform, without specifying detailed state changes c.f. imperative programming (functional and logic programming are major subgroups of declarative programing)
  • 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 templates are used by a compiler 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

List of multi-paradigm programming languages
Language Num­ber of Para­digms Con­cur­rent Con­straints Data­flow De­clar­at­ive Dis­trib­uted Func­tion­al Meta­pro­gram­ming Gen­er­ic Im­per­at­ive Lo­gic Re­flec­tion Ob­ject-ori­ented Pipe­lines Visu­al Rule-based Oth­er para­digms
Ada[2][3][4][5][6]5 Yes[a 1]NoNoNoYesNoNoYesYesNoNoYes[a 2]NoNoNoNo
ALF2 NoNoNoNoNoYesNoNoNoYesNoNoNoNoNoNo
AmigaE2 NoNoNoNoNoNoNoNoYesNoNoYes[a 2]NoNoNoNo
APL3 NoNoNoNoNoYesNoNoYesNoNoNoNoNoNoArray (multi-dimensional)
BETA 3 NoNoNoNoNoYesNoNoYesNoNoYes[a 2]NoNoNoNo
C++7 (15) Yes[7][8][9]Library[10]Library[11][12]Library[13][14]Library[15][16]YesYes[17]Yes[a 3]YesLibrary[18][19]Library[20]Yes[a 2]Yes[21]NoLibrary[22]Array (multi-dimensional; using STL)
C#6 (7) YesNoLibrary[a 4]NoNoYes[a 5]NoYesYesNoYesYes[a 2]NoNoNoreactive[a 6]
ChucK 3 YesNoNoNoNoNoNoNoYesNoNoYes[a 2]NoNoNoNo
Claire2 NoNoNoNoNoYesNoNoNoNoNoYes[a 2]NoNoNoNo
Clojure5 Yes[23][24]NoNoYesNoYes[25]Yes[26]NoNoLibrary[27]NoNoYes[28]Editor[29]NoMultiple dispatch[30], Agents[31]
Common Lisp5 Library[32]Library[33]Library[34]Yes[35]Library[36]YesYesYes[37]YesLibrary[38]YesYes (multiple dispatch, method combinations)[39][a 2]Library[40]NoLibrary[41]Multiple dispatch, meta-OOP system[42], Language is extensible via metaprogramming.
Curl5 NoNoNoNoNoYesNoYes[a 3]YesNoYesYes[a 2]NoNoNoNo
Curry4 YesYesNoNoNoYesNoNoNoYesNoNoNoNoNoNo
D (version 2.0)[43][44]6 Yes[a 7]NoNoNoNoYesYes[45][a 3]Yes[a 3]YesNoNoYes[a 2]NoNoNoNo
Dylan3 NoNoNoNoNoYesNoNoNoNoYesYes[a 2]NoNoNoNo
E3 YesNoNoNoYesNoNoNoNoNoNoYes[a 2]NoNoNoNo
ECMAScript[46][47] (ActionScript, E4X, JavaScript, JScript)4 (5) partial (promises, native extensions)[a 8]NoNoLibrary[48][49][50]NoYesNoNoYesNoYesYes[a 9]Library[51][52]Editor[53]Noreactive[a 10][54], event driven[a 11][a 12]
Embarcadero Delphi3 NoNoNoNoNoNoNoYes[a 3]YesNoNoYes[a 2]NoNoNoNo
Erlang3 YesNoNoYesYesYesNoNoNoNoNoNoYesNoNoNo
Elixir4 YesNoNoNoYesYesYesNoNoNoNoNoYesNoNoNo
Elm6 YesNoYesYesNoYesNoYesNoNoNoNoYesNoNoreactive
F#7 (8) Yes[a 7]NoLibrary[a 4]YesNoYesNoYesYesNoYesYes[a 2]NoNoNoreactive[a 6]
Fortran4 (5) YesNoNoNoNoYes[a 13]NoYes[a 14]NoNoNoYes[a 2]NoNoNoArray (multi-dimensional)
Go4 YesNoNoNoNoNoNoNoYesNoYesNoYesNoNoNo
Haskell8 (15) YesLibrary[55]Library[56]YesLibrary[57]Yes (lazy)Yes[58]YesYesLibrary[59]NoImmutableYesYesLibrary[60]literate, reactive, dependent types (partial)
Io4 Yes[a 7]NoNoNoNoYesNoNoYesNoNoYes[a 9]NoNoNoNo
J 3 NoNoNoNoNoYesNoNoYesNoNoYes[a 2]NoNoNoNo
Java6 YesLibrary[61]Library[62]NoNoYesNoYesYesNoYesYes[a 2]NoNoNoNo
Julia9 (17) YesLibrary[63]Library[64][65]Library[66]YesYes (eager)YesYesYesLibrary[67]YesYes (multiple dispatch, not traditional single)YesNoLibrary[68][69]Multiple dispatch,
Array (multi-dimensional); optionally lazy[70] and reactive (with libraries)
Kotlin8 YesNoNoNoNoYesYesYesYesNoYesYesYesNoNoNo
LabVIEW4 YesNoYesNoNoNoNoNoNoNoNoYesNoYesNoNo
Lava2 NoNoNoNoNoNoNoNoNoNoNoYes[a 2]NoYesNoNo
LispWorks (version 6.0 with support for symmetric multi-processing, rules, logic (Prolog), CORBA)9 YesNoNoNoYesYesYesNoYesYesYesYes[a 2]NoNoYesNo
Lua 3 NoNoNoNoNoYesNoNoYesNoNoYes[a 9]NoNoNoNo
MATLAB6 (10) Toolbox[71]Toolbox[72]Yes[73]NoToolbox[74]NoYes[75]Yes[76]NoNoYes[77]Yes[78]NoYes[79]NoArray (multi-dimensional)
Nemerle7 YesNoNoNoNoYesYesYesYesNoYesYes[a 2]NoNoNoNo
Object Pascal4 YesNoNoNoNoYesNoNoYesNoNoYes[a 2]NoNoNoNo
OCaml4 NoNoNoNoNoYesNoYesYesNoNoYes[a 2]NoNoNoNo
Oz11 YesYesYesYesYesYesNoNoYesYesNoYes[a 2]YesNoYesNo
Perl 8 (9) Yes[80]Library[81]Yes[82]NoNoYesYesNoYesNoYes[a 2]Yes[a 2]YesNoNoNo
Raku10 Yes[83]Yes[84]Yes[85]NoLibrary[86]YesYes[87]Yes[88]YesNoYes[89]Yes[90]YesNoNoMultiple dispatch, lazy lists, reactive.
PHP[91][92][93]4 NoNoNoNoNoYesNoNoYesNoYesYes[a 2]NoNoNoNo
Poplog3 NoNoNoNoNoYesNoNoYesYesNoNoNoNoNoNo
Prograph3 NoNoYesNoNoNoNoNoNoNoNoYes[a 2]NoYesNoNo
Python5 (10) Library[94][95] Library[96] No No Library[97] Partial Yes[98][99] Yes[100][101]YesLibrary[102]YesYes[a 2] NoEditor[103]Nostructured
R4 NoNoNoNoNoYesNoNoYesNoYesYesYes[104]NoNoArray (multi-dimensional)
Racket6 Yes[105]NoNoNoNoYesYesNoYesYesYesYesNoNoNoNo
ROOP3 NoNoNoNoNoNoNoNoYesYesNoNoNoNoYesNo
Ruby5 NoNoNoNoNoYesYesNoYesNoYesYes[a 2]NoNoNoNo
Rust (version 1.0.0-alpha)6 Yes[a 7]NoNoNoNoYesYes[106][107]Yes[108]YesNoNoYesNoNoNolinear, affline, and ownership types
Sather2 NoNoNoNoNoYesNoNoNoNoNoYes[a 2]NoNoNoNo
Scala[109][110]9 Yes[a 7]NoYes[a 15]YesNoYesYesYesYesNoYesYes[a 2]NoNoNoNo
Simula2 NoNoNoNoNoNoNoNoYesNoNoYes[a 2]NoNoNoNo
SISAL3 YesNoYesNoNoYesNoNoNoNoNoNoNoNoNoNo
Spreadsheets2 NoNoNoNoNoYesNoNoNoNoNoNoNoYesNoNo
Swift7 YesNoNoNoNoYesYesYesYesNoYesYes[a 2]NoNoNoblock-structured
Tcl with Snit extension 3 NoNoNoNoNoYes[111]NoNoYesNoNoYes[a 9][112]NoNoNoNo
Visual Basic .NET6 (7) YesNoLibrary[a 4]NoNoYesNoYesYesNoYesYes[a 2]NoNoNoreactive[a 6]
Windows PowerShell6 NoNoNoNoNoYesNoYesYesNoYesYes[a 2]YesNoNoNo
Wolfram Language & Mathematica13[113] (14) YesYesYesYesYesYesYesYesYesYesYesYesYes[114]NoYesKnowledge Based

See also

Notes

  1. rendezvous and monitor-like based
  2. Class-based
  3. Template metaprogramming
  4. using TPL Dataflow
  5. only lambda support (lazy functional programming)
  6. using Reactive Extensions (Rx)
  7. actor programming
  8. using Node.js' cluster module or child_process.fork method, web workers in the browser, etc.
  9. Prototype-based
  10. using Reactive Extensions (RxJS)
  11. in Node.js via their events module
  12. in browsers via their native EventTarget API
  13. purely functional
  14. parameterized classes
  15. Akka Archived 2013-01-19 at the Wayback Machine

Citations

  1. Bragg, S.D.; Driskill, C.G. (20–22 September 1994). "Diagrammatic-graphical programming languages and DoD-STD-2167A". Proceedings of AUTOTESTCON '94. IEEEXplore. IEEE. pp. 211–220. doi:10.1109/AUTEST.1994.381508. ISBN 978-0-7803-1910-3.
  2. Ada Reference Manual, ISO/IEC 8652:2005(E) Ed. 3, Section 9: Tasks and Synchronization
  3. Ada Reference Manual, ISO/IEC 8652:2005(E) Ed. 3 Annex E: Distributed Systems
  4. Ada Reference Manual, ISO/IEC 8652:2005(E) Ed. 3, Section 12: Generic Units
  5. Ada Reference Manual, ISO/IEC 8652:2005(E) Ed. 3, Section 6: Subprograms
  6. Ada Reference Manual, ISO/IEC 8652:2005(E) Ed. 3, 3.9 Tagged Types and Type Extensions
  7. Thread support
  8. Atomics support
  9. Memory model
  10. Gecode
  11. SystemC
  12. Boost.Iostreams
  13. Boolinq
  14. AraRat
  15. OpenMPI
  16. Boost.MPI
  17. Boost.MPL
  18. LC++
  19. Castor Archived 2013-01-25 at the Wayback Machine
  20. Reflect Library
  21. N3534
  22. Boost.Spirit
  23. Clojure - Concurrent Programming
  24. Clojure - core.async
  25. Clojure - Functional Programming
  26. Clojure - Macros
  27. Clojure - core.logic
  28. Clojure - Threading Macros Guide
  29. "Light Table". 2019-04-08.
  30. Multimethods and Hierarchies
  31. Agents and Asynchronous Actions
  32. many concurrency paradigms implemented as language extensions
  33. constraint programming inside CL through extensions
  34. dataflow extension
  35. by creating DSLs using the built-in metaprogramming; also see note on functional, constraint and logic paradigms, which are part of declarative
  36. MPI, etc via language extensions
  37. template metaprogramming using macros (see C++)
  38. Prolog implemented as a language extension
  39. Common Lisp Object System see Wikipedia article on CLOS, the Common Lisp Object System.
  40. implemented by the user via a short macro, example of implementation:
  41. rule-based programming extension
  42. through the Meta Object Protocol
  43. D Language Feature Table
  44. Phobos std.algorithm
  45. D language String Mixins
  46. The Little JavaScripter demonstrates fundamental commonality with Scheme, a functional language.
  47. Object Oriented Programming in JavaScript Archived 2019-02-10 at the Wayback Machine gives an overview of object-oriented programming techniques in JavaScript.
  48. "React – A JavaScript library for building user interfaces". 2019-04-08.
  49. "React – A JavaScript library for building user interfaces". 2019-04-08.
  50. "TNG-Hooks". 2019-04-08.
  51. "Lodash documentation". 2019-04-08.
  52. "mori". 2019-04-08.
  53. "Light Table". 2019-04-08.
  54. "TNG-Hooks". 2019-04-08.
  55. Prolog embedding
  56. "Functional Reactive Programming - HaskellWiki".
  57. Cloud Haskell
  58. "Template Haskell - HaskellWiki".
  59. "Logict: A backtracking logic-programming monad".
  60. https://jcp.org/en/jsr/detail?id=331 JSR 331: Constraint Programming API
  61. https://github.com/GoogleCloudPlatform/DataflowJavaSDK Google Cloud Platform Dataflow SDK
  62. "JuliaOpt/JuMP.jl". GitHub. JuliaOpt. 11 February 2020. Retrieved 12 February 2020.
  63. "GitHub - MikeInnes/DataFlow.jl". 2019-01-15.
  64. "GitHub - JuliaGizmos/Reactive.jl: Reactive programming primitives for Julia". 2018-12-28.
  65. https://github.com/davidanthoff/Query.jl Query almost anything in julia
  66. https://github.com/lilinjn/LilKanren.jl A collection of Kanren implementations in Julia
  67. "GitHub - abeschneider/PEGParser.jl: PEG Parser for Julia". 2018-12-03.
  68. "GitHub - gitfoxi/Parsimonious.jl: A PEG parser generator for Julia". 2017-08-03.
  69. Lazy https://github.com/MikeInnes/Lazy.jl
  70. "Execute loop iterations in parallel". mathworks.com. Retrieved 21 October 2016.
  71. "Write Constraints". mathworks.com. Retrieved 21 October 2016.
  72. "Getting Started with SimEvents". mathworks.com. Retrieved 21 October 2016.
  73. "Execute loop iterations in parallel". mathworks.com. Retrieved 21 October 2016.
  74. "Execute MATLAB expression in text - MATLAB eval". mathworks.com. Retrieved 21 October 2016.
  75. "Determine class of object". mathworks.com. Retrieved 21 October 2016.
  76. "Class Metadata". mathworks.com. Retrieved 21 October 2016.
  77. "Object-Oriented Programming". mathworks.com. Retrieved 21 October 2016.
  78. "Simulink". mathworks.com. Retrieved 21 October 2016.
  79. interpreter based threads
  80. Moose
  81. Higher Order Perl
  82. Channels and other mechanisms
  83. "Class Signature".
  84. Feed operator
  85. https://github.com/perl6/doc/issues/1744#issuecomment-360565196 Cro module
  86. "Meta-programming: What, why and how". 2011-12-14.
  87. https://perl6advent.wordpress.com/2009/12/18/day-18-roles/ Parametrized Roles
  88. "Meta-object protocol (MOP)".
  89. https://docs.perl6.org/language/classtut Classes and Roles
  90. PHP Manual, Chapter 17. Functions
  91. PHP Manual, Chapter 19. Classes and Objects (PHP 5)
  92. PHP Manual, Anonymous functions
  93. "Parallel Processing and Multiprocessing in Python". wiki.python.org. Retrieved 21 October 2016.
  94. "threading — Higher-level threading interface". docs.python.org. Retrieved 21 October 2016.
  95. "python-constraint". pypi.python.org. Retrieved 21 October 2016.
  96. "DistributedProgramming". wiki.python.org. Retrieved 21 October 2016.
  97. "Chapter 9. Metaprogramming". chimera.labs.oreilly.com. Archived from the original on 23 October 2016. Retrieved 22 October 2016.
  98. "Metaprogramming". readthedocs.io. Retrieved 22 October 2016.
  99. "PEP 443 -- Single-dispatch generic functions". python.org. Retrieved 22 October 2016.
  100. "PEP 484 -- Type Hints". python.org. Retrieved 22 October 2016.
  101. "PyDatalog". Retrieved 22 October 2016.
  102. "Light Table". 2019-04-08.
  103. "Magrittr: A Forward Pipe Operator for R". cran.r-project.org\accessdate=13 July 2017.
  104. Racket Guide: Concurrency and Synchronization
  105. "The Rust macros guide". Rust. Retrieved 19 January 2015.
  106. "The Rust compiler plugins guide". Rust. Retrieved 19 January 2015.
  107. The Rust Reference §6.1.3.1
  108. An Overview of the Scala Programming Language
  109. Scala Language Specification
  110. "Tcl Programming/Introduction". en.wikibooks.org. Retrieved 22 October 2016.
  111. "TCLLIB - Tcl Standard Library: snitfaq". sourceforge.net. Retrieved 22 October 2016.
  112. Notes for Programming Language Experts, Wolfram Language Documentation.
  113. External Programs, Wolfram Language Documentation.

References

  • Jim Coplien, Multiparadigm Design for C++, Addison-Wesley Professional, 1998.
This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.