Comparison of multi-paradigm programming languages

From Wikipedia, the free encyclopedia

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 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 Number of Paradigms Concurrent Constraints Data­flow Declarative Distributed Functional Meta­programming Generic Imperative Logic Reflection Object­oriented Pipe­lines 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[citation needed] 2 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[citation needed] 3 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] No Library[41] Multiple dispatch, meta-OOP system,[42] 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)[43][44] 6 Yes[a 7] No No No No Yes Yes[45][a 3] 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[46][47] (ActionScript, E4X, JavaScript, JScript) 4 (5) partial (promises, native extensions)[a 8] No No Library[48][49] No Yes No No Yes No Yes Yes[a 9] Library[50][51] Editor[52] No reactive,[a 10][53] event driven[a 11][a 12]
Embarcadero Delphi 3 No No No No No No No Yes[a 3] Yes No No Yes[a 2] No No No No
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 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[54] Library[55] Yes Library[56] Yes (lazy) Yes[57] Yes Yes Library[58] No Immutable Yes Yes Library[59] 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[60] Library[61] No No Yes No Yes Yes No Yes Yes[a 2] No No No No
Julia 9 (17) Yes Library[62] Library[63][64] Library[65] Yes Yes (eager) Yes Yes Yes Library[66] Yes Yes (multiple dispatch, not traditional single) Yes No Library[67][68] Multiple dispatch,
Array (multi-dimensional); optionally lazy[69] 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[70] Toolbox[71] Yes[72] No Toolbox[73] No Yes[74] Yes[75] No No Yes[76] Yes[77] No Yes[78] 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[citation needed] 8 (9) Yes[79] Library[80] Yes[81] No No Yes Yes No Yes No Yes[a 2] Yes[a 2] Yes No No No
PHP[82][83][84] 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[85][86] Library[87] No No Library[88] Partial Yes[89][90] Yes[91][92] Yes Library[93] Yes Yes[a 2] No Editor[94] No structured
R 4 No No No No No Yes No No Yes No Yes Yes Yes[95] No No Array (multi-dimensional)
Racket 10 Yes[96] Yes[97] Yes[98] No Yes[99] Yes Yes No Yes Yes Yes Yes No No No Lazy[100]
Raku 10 Yes[101] Yes[102] Yes[103] No Library[104] Yes Yes[105] Yes[106] Yes No Yes[107] Yes[108] 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[109][110] Yes[111] Yes No No Yes No No No linear, affline, and ownership types
Sather[citation needed] 2 No No No No No Yes No No No No No Yes[a 2] No No No No
Scala[112][113] 9 Yes[a 7] No Yes[a 15] Yes No Yes Yes Yes Yes No Yes Yes[a 2] No No No No
Simula[citation needed] 2 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[114] No No Yes No No Yes[a 9][115] 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[116] (14) Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes[117] No Yes Knowledge Based

See also[]

Notes[]

  1. ^ rendezvous and monitor-like based
  2. ^ Jump up to: a b c d e f g h i j k l m n o p q r s t u v w x y z aa ab ac ad ae af ag ah ai Class-based
  3. ^ Jump up to: a b c d e Template metaprogramming
  4. ^ Jump up to: a b c using TPL Dataflow
  5. ^ only lambda support (lazy functional programming)
  6. ^ Jump up to: a b c using Reactive Extensions (Rx)
  7. ^ Jump up to: a b c d e actor programming
  8. ^ using Node.js' cluster module or child_process.fork method, web workers in the browser, etc.
  9. ^ Jump up to: a b c d 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. ^ [1] many concurrency paradigms implemented as language extensions
  33. ^ [2] constraint programming inside CL through extensions
  34. ^ [3] dataflow extension
  35. ^ [4] by creating DSLs using the built-in metaprogramming; also see note on functional, constraint and logic paradigms, which are part of declarative
  36. ^ [5] MPI, etc via language extensions
  37. ^ template metaprogramming using macros (see C++)
  38. ^ [6] [7] [8] 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: [9]
  41. ^ [10] rule-based programming extension
  42. ^ [11] 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. ^ "TNG-Hooks". 2019-04-08.
  50. ^ "Lodash documentation". 2019-04-08.
  51. ^ "mori". 2019-04-08.
  52. ^ "Light Table". 2019-04-08.
  53. ^ "TNG-Hooks". 2019-04-08.
  54. ^ Prolog embedding
  55. ^ "Functional Reactive Programming - HaskellWiki".
  56. ^ Cloud Haskell
  57. ^ "Template Haskell - HaskellWiki".
  58. ^ "Logict: A backtracking logic-programming monad".
  59. ^ [12]
  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. ^ PHP Manual, Chapter 17. Functions
  83. ^ PHP Manual, Chapter 19. Classes and Objects (PHP 5)
  84. ^ PHP Manual, Anonymous functions
  85. ^ "Parallel Processing and Multiprocessing in Python". wiki.python.org. Retrieved 21 October 2016.
  86. ^ "threading — Higher-level threading interface". docs.python.org. Retrieved 21 October 2016.
  87. ^ "python-constraint". pypi.python.org. Retrieved 21 October 2016.
  88. ^ "DistributedProgramming". wiki.python.org. Retrieved 21 October 2016.
  89. ^ "Chapter 9. Metaprogramming". chimera.labs.oreilly.com. Archived from the original on 23 October 2016. Retrieved 22 October 2016.
  90. ^ "Metaprogramming". readthedocs.io. Retrieved 22 October 2016.
  91. ^ "PEP 443 -- Single-dispatch generic functions". python.org. Retrieved 22 October 2016.
  92. ^ "PEP 484 -- Type Hints". python.org. Retrieved 22 October 2016.
  93. ^ "PyDatalog". Retrieved 22 October 2016.
  94. ^ "Light Table". 2019-04-08.
  95. ^ "Magrittr: A Forward Pipe Operator for R". cran.r-project.org\accessdate=13 July 2017.
  96. ^ Racket Guide: Concurrency and Synchronization
  97. ^ The Rosette Guide
  98. ^ FrTime: A Language for Reactive Programs
  99. ^ Racket Guide: Distributed Places
  100. ^ Lazy Racket
  101. ^ Channels and other mechanisms
  102. ^ "Class Signature".
  103. ^ Feed operator
  104. ^ https://github.com/perl6/doc/issues/1744#issuecomment-360565196 Cro module
  105. ^ "Meta-programming: What, why and how". 2011-12-14.
  106. ^ https://perl6advent.wordpress.com/2009/12/18/day-18-roles/ Parametrized Roles
  107. ^ "Meta-object protocol (MOP)".
  108. ^ https://docs.perl6.org/language/classtut Classes and Roles
  109. ^ "The Rust macros guide". Rust. Retrieved 19 January 2015.
  110. ^ "The Rust compiler plugins guide". Rust. Retrieved 19 January 2015.
  111. ^ The Rust Reference §6.1.3.1
  112. ^ An Overview of the Scala Programming Language
  113. ^ Scala Language Specification
  114. ^ "Tcl Programming/Introduction". en.wikibooks.org. Retrieved 22 October 2016.
  115. ^ "TCLLIB - Tcl Standard Library: snitfaq". sourceforge.net. Retrieved 22 October 2016.
  116. ^ Notes for Programming Language Experts, Wolfram Language Documentation.
  117. ^ External Programs, Wolfram Language Documentation.

References[]

  • Jim Coplien, Multiparadigm Design for C++, Addison-Wesley Professional, 1998.
Retrieved from ""