Comparison of programming languages

General comparison
Basic syntax
Basic instructions
Arrays
Associative arrays
String operations
String functions
List comprehension
Object-oriented programming
Object-oriented constructors
Database access
Database RDBMS
Evaluation strategy
List of "hello world" programs

ALGOL 58's influence on ALGOL 60
ALGOL 60: Comparisons with other languages
Comparison of ALGOL 68 and C++
ALGOL 68: Comparisons with other languages
Compatibility of C and C++
Comparison of Pascal and Borland Delphi
Comparison of Pascal and C
Comparison of Java and C++
Comparison of C# and Java
Comparison of C# and Visual Basic .NET
This box: [[|view]]·[[|talk]]·edit

Programming languages are used for controlling the behavior of a machine (often a computer). Like natural languages, programming languages conform to rules for syntax and semantics.

There are thousands of programming languages[1] and new ones are created every year. Few languages ever become sufficiently popular that they are used by more than a few people, but professional programmers can easily use dozens of different languages during their career.


General comparison

The following table compares general and technical information for a selection of commonly used programming languages. See the individual languages' articles for further information. Please note that the following table may be missing some information.

Language Intended use Paradigm(s) Standardized?
ActionScript 3.0 Application, Web, Client-side imperative, object-oriented, event-driven 1996, ECMA
Ada Application, Embedded, System and Realtime imperative, procedural[2], concurrent[3], distributed[4], generic[5], object-oriented[6] 1983, ANSI, ISO, GOST 27831-88[7]
ALGOL 58 Application imperative No
ALGOL 60 Application imperative 1960, IFIP WG 2.1, ISO[8]
ALGOL 68 Application imperative, concurrent 1968, IFIP WG 2.1, GOST 27974-88,[9]
Ateji PX Parallel Application object-oriented, pi calculus No
Gr8it Application imperative No
APL Application, Data processing array-oriented, tacit 1989, ISO
Assembly language General imperative, any No
AutoHotkey Highly domain-specific, GUI automation(macros) imperative No
AutoIt Highly domain-specific, GUI automation(macros) event-driven, imperative, procedural No
BASIC Application, Education imperative, procedural 1983, ANSI, ISO
BeanShell Application, Scripting imperative, object-oriented, functional, reflective In progress, JCP[10]
BLISS System procedural No
BlitzMax Application, Game imperative, procedural, object-oriented No
Boo Application No
C System[11] imperative, procedural 1989, ANSI C89, ISO C90/C99
C++ Application; System imperative, procedural, object-oriented, generic 1998, ISO
C# Application, Web imperative, object-oriented, functional,[12] generic, reflective 2000, ECMA, ISO[13]
Clarion General, Web, Business imperative, object-oriented, functional[14] Unknown
Clean General functional, generic No
Clojure General functional, concurrent No
CLU General imperative, procedural, object-oriented, generic No
COBOL Application, Business imperative, object-oriented 1960
Cobra General, Application, Business, Web imperative, object-oriented, functional, generic, reflective No
ColdFusion (CFML) Web Development procedural, object-oriented No
Common Lisp General imperative, functional, object-oriented, reflective, generic 1994, ANSI
Comal 80 Education imperative, procedural No
Curl imperative, event-driven, functional, object-oriented, generic, reflective No
Cython General, Application, Numerical Computing imperative, object-oriented, functional, aspect-oriented, reflective No
D Application; System imperative, object-oriented, generic No
Dylan Application functional, object-oriented No
Eiffel Application imperative, object-oriented, generic 2005, ECMA, ISO[15]
Erlang Application, Distributed, Telecom functional, concurrent, distributed No
Euphoria Application procedural No
Factor stack-oriented No
FP functional No
F# Application imperative, functional, object-oriented, generic No
Forth General imperative, stack-oriented 1994, ANSI
Fortran Application, Numerical Computing imperative, procedural, object-oriented, generic 1966, ANSI 66, ANSI 77, MIL-STD-1753, ISO 90, ISO 95, ISO 2003
Gambas Application imperative, object-oriented, event-driven No
Game Maker Language Application, Games imperative, object-oriented, event-driven No
Go Application; System concurrent, imperative No
GraphTalk Application logic-oriented, object-oriented No
Groovy Application, Web imperative, object-oriented, aspect-oriented In progress, JCP[16]
Harbour General, Application, Business, Web, Data processing imperative, procedural, functional, object-oriented, declarative, generic, reflective No
Haskell Application functional, generic, lazy evaluation 1998, Haskell 98[17]
HyperNext Application, Education procedural, weakly typed, event-driven No
Io Application, Host-driven Scripting imperative, object-oriented No
J Data processing array-oriented, function-level, tacit No
JADE Application, Distributed imperative, object-oriented No
Java Application, Web imperative, object-oriented, generic, reflective No, Java Language Specification
JavaScript Web, Client-side imperative, object-oriented, functional, reflective 1997, ECMA
Joy Research functional, stack-oriented No
LabVIEW ("G") Application, Industrial instrumentation and automation dataflow, visual No
Lisp Text processing functional
Logtalk Application, Artificial intelligence logic, object-oriented, event-driven, reflective No
Lua Embedded scripting, Application imperative, object-oriented, functional, aspect-oriented, reflective No[18]
Mathematica Highly domain-specific, Symbolic Computing procedural, functional No
MATLAB Highly domain-specific, Numerical Computing imperative, procedural, object-oriented No
Modula-2 Application; System imperative, generic 1996, ISO[19]
Modula-3 Application imperative, object-oriented, generic No
Mythryl Application, Scripting imperative, generic, functional No
Oberon Application; System imperative, object-oriented No
Objective-C Application imperative, object-oriented, reflective No[20]
Objective Caml Application imperative, object-oriented, functional, generic No
Object Pascal (Delphi) Application imperative, object-oriented, generic, event-driven, reflective, aspect-oriented[21] No
Occam General imperative, procedural, concurrent, process-oriented No
Oxygene Application imperative, object-oriented, generic No
Oz Application, Education, Distribution imperative, logic, functional, object-oriented, concurrent No
Pascal Application, Education imperative, procedural 1983, ISO[22]
Pawn Embedded, Host-driven Scripting imperative No
Perl Application, Text processing, Scripting, Web imperative, procedural, reflective, functional, object-oriented, generic No
PHP Web, Server-side imperative, procedural[23], object-oriented[24], reflective No
PL/I Application imperative, procedural, object-oriented 1969
Plus System development, Application imperative, procedural No
Prolog Application, Artificial intelligence logic 1995, ISO
Python General, Application, Scripting, Web imperative, object-oriented, functional, aspect-oriented, reflective No[25]
REALbasic Application
REBOL Distributed imperative, object-oriented, functional, dialected No
RPG Application
Ruby Application, Scripting, Web imperative, object-oriented, aspect-oriented, reflective, functional No
S Application, Statistics imperative, procedural, functional, object-oriented No
S-Lang Application, Scripting, Numerical imperative, procedural No
Scala Application, Distributed object-oriented, functional, generic, lazy evaluation, imperative No
Scheme General, Education functional 1998, R6RS
Simula General, Education imperative, object-oriented, event-driven, discrete event simulation, multi-threaded (quasi-parallel) program execution 1968
Smalltalk Application, Education object-oriented, concurrent, event-driven, declarative, reflective 1998, ANSI
SNOBOL Text processing
Standard ML Application imperative, functional, generic 1997, SML '97[26]
Tcl Application, Scripting, Web imperative, procedural, event-driven No
Visual Basic Application, Education imperative, component-oriented, event-driven No
Visual Basic .NET Application, Education, Web imperative, object-oriented, event-driven No
Visual Prolog Application imperative, declarative, logical, object-oriented, functional, event-driven No
Windows PowerShell Administration imperative, object-oriented, functional, pipeline, reflective No
XL imperative, concept programming, object-oriented No
Language Intended use Paradigm(s) Standardized?

Type systems

Brief Definitions

  • Compatibility among composite types is how functions are applied to data typed similarly to its intended type. Name-based compatibility means that functions work only on data of its intended type and declared subtypes. Property-based compatibility means that functions work on any data that has the same properties as its intended type.
  • Type checking is how type errors are checked. Static checking occurs at compile-time. Dynamic checking occurs at run-time.
Language Type strength Type safety Expression of types Compatibility among composite types Type checking
ActionScript 3.0 strong safe implicit with optional explicit typing static
Ada strong mostly safe[27] explicit name-based partially dynamic[28]
ALGOL 58 strong safe explicit static
ALGOL 60 strong safe explicit static
ALGOL 68 strong safe explicit property-based static
APL strong safe dynamic
AutoHotkey none
Ateji PX strong safe explicit name-based static
BASIC varies by dialect
BLISS none n/a n/a n/a n/a
BeanShell strong safe name-based dynamic
Boo strong safe implicit with optional explicit typing static with optional dynamic typing
C strong unsafe explicit name-based static
C++ (ISO/IEC 14882) strong unsafe explicit name-based static[29]
C# strong safe[30] explicit name-based static[31]
Clean strong safe implicit static
Clojure strong safe implicit with optional explicit typing dynamic
COBOL strong static
ColdFusion(CFML) strong safe implicit dynamic
Common Lisp strong safe implicit with optional explicit typing dynamic
Curl strong safe name-based
Cython strong safe implicit with optional explicit typing name-based (extension types) and property-based (Python) dynamic with optional static typing
D strong unsafe[32] explicit name-based static
Dylan strong safe dynamic
Eiffel strong safe name-based static
Erlang strong safe implicit dynamic
F# strong safe implicit name-based static
Forth none n/a n/a n/a n/a
Fortran strong safe explicit name-based static
Gambas strong safe explicit name-based
Go[33] strong safe implicit with optional explicit typing property-based static
GraphTalk weak
Groovy strong safe implicit dynamic
Harbour strong safe implicit with optional explicit typing dynamic
Haskell strong safe implicit with optional explicit typing property-based static
Io strong dynamic
J strong safe dynamic
Java strong safe[34] explicit name-based static
JavaScript weak implicit dynamic
Joy strong safe dynamic
Lua weak safe implicit dynamic
Mathematica strong dynamic
MATLAB M-code dynamic
Modula-2 strong unsafe[32] explicit name-based static
Modula-3 strong unsafe[32] explicit property-based static
Oberon strong safe explicit name-based static and partially dynamic[35]
Objective-C weak safe explicit name-based (subclassing) and property-based (protocols) dynamic with optional static typing[36]
Objective Caml strong safe implicit with optional explicit typing property-based static
Object Pascal (Delphi) strong safe explicit name-based static
Oxygene strong unsafe implicit static
Oz strong safe implicit property-based dynamic
Pascal strong unsafe[32] explicit name-based static
Perl 5 weak implicit dynamic
Perl 6 partially implicit[37] dynamic with optional static typing
PHP weak implicit dynamic
Plus strong safe explicit property-based static, dynamic (optional)
Prolog strong dynamic
Pure dynamic
Python strong safe implicit property-based dynamic
REBOL strong safe implicit dynamic
Ruby strong safe implicit property-based dynamic
S strong dynamic
S-Lang strong safe implicit dynamic
Scala strong safe partially implicit (local type inference) name-based (subclassing) and property-based (structural) static
Scheme strong implicit dynamic (latent)
Simula strong safe static[38]
Smalltalk strong safe implicit dynamic
Standard ML strong safe implicit with optional explicit typing property-based static
Tcl dynamic
Visual Basic strong safe implicit with optional explicit typing name-based static
Visual Basic .NET strong unsafe[32] explicit static
Visual Prolog strong safe partially implicit name-based static
Windows PowerShell strong safe implicit dynamic
XL strong safe name-based static
Language Type strength Type safety Expression of types Compatibility among composite types Type checking
  1. As of May 2006 Diarmuid Pigott's Encyclopedia of Computer Languages hosted at Murdoch University, Australia lists 8512 computer languages.
  2. Ada Reference Manual, ISO/IEC 8652:2005(E) Ed. 3, Section 6: Subprograms
  3. Ada Reference Manual, ISO/IEC 8652:2005(E) Ed. 3, Section 9: Tasks and Synchronization
  4. Ada Reference Manual, ISO/IEC 8652:2005(E) Ed. 3 Annex E: Distributed Systems
  5. Ada Reference Manual, ISO/IEC 8652:2005(E) Ed. 3, Section 12: Generic Units
  6. Ada Reference Manual, ISO/IEC 8652:2005(E) Ed. 3, 3.9 Tagged Types and Type Extensions
  7. Vak.ru
  8. ISO 1538:1984
  9. Vak.ru
  10. JSR 274
  11. CM.bell-labs.com
  12. Codeproject.com
  13. ECMA-334; ISO/IEC 23270:2006
  14. Softvelocity.com
  15. ECMA-367; ISO/IEC 25436:2006
  16. JSR 241
  17. . http://www.haskell.org/onlinereport/. Retrieved 2009-03-07.  Most Haskell implementations extend the Haskell 98 standard.
  18. Version releases are accompanied with a definitive Lua Reference Manual showing full syntax and semantics; a reference implementation, and a test suite. These are used to generate other Lua VM implementations and compilers such as Kahlua and LLVM-Lua.
  19. ISO/IEC 10514-1:1996
  20. GCC.GNU.org
  21. Cirrus: Aspect-oriented programming in Delphi Prism
  22. ISO 7185
  23. PHP Manual, Chapter 17. Functions
  24. PHP Manual, Chapter 19. Classes and Objects (PHP 5)
  25. Language changes are done using a formally documented procedure, starting with a Python Enhancement Proposal (PEP)s. Python version releases are accompanied with a Language Reference Manual showing syntax and semantics; a reference implementation, and test suite. These are used to generate other Python implementations such as Jython and IronPython.
  26. SMLNJ.org
  27. Unsafe operations are well isolated by a "Unchecked_" prefix.
  28. Dynamic type checking is used when type safety can not be determined staticly i.e. for tagged types (type extension / inheritance), numeric ranges and array bounds.
  29. with optional dynamic type casting (see dynamic cast)
  30. Safe, but supports unsafe code through an explicit declaration
  31. with optional dynamic type (see dynamic member lookup)
  32. a b c d e It is almost safe, unsafe features are not commonly used.
  33. The Go Programming Language Specification
  34. Sheng Liang, Gilad Bracha. Dynamic class loading in the Java virtual machine. Volume 33, Issue 10 of ACM SIGPLAN Notices, October 1998.
  35. dynamic checking of type extensions i.e. inherited types
  36. Developer.apple.com
  37. explicit for static types
  38. optional for formal and virtual procedures

Failsafe I/O and system calls

Most programming languages will print an error message and/or throw an exception if an input/output operation or other system call (e.g., chmod, kill) fails, unless the programmer has explicitly arranged for different handling of these events. Thus, these languages fail safely in this regard.

Some (mostly older) languages require that the programmer explicitly add checks for these kinds of errors. It is common for novice programmers to forget to add these checks, and even experts occasionally do so—these omissions can lead to erroneous behavior.

Language Failsafe I/O
Ada Yes (exceptions)
AutoHotkey No (global ErrorLevel must be explicitly checked)
C No[39]
C++ No[40]
C# Yes
Common Lisp Yes
D Yes ?
Erlang Yes
Harbour Yes
Haskell Yes
Java Yes[41]
Lua No (some functions do not warn or throw exceptions)
Mathematica ?
Objective Caml Yes (exceptions)
Objective-C Yes (exceptions)
Object Pascal (Delphi) Some
Perl No[42]
PHP Yes
Python Yes
REBOL Yes
Ruby Yes
S ?
Scala Yes ?
Standard ML Yes ?
Tcl Yes
Visual Basic Yes
Visual Prolog Yes
Language Failsafe I/O
  1. As of May 2006 Diarmuid Pigott's Encyclopedia of Computer Languages hosted at Murdoch University, Australia lists 8512 computer languages.
  2. Ada Reference Manual, ISO/IEC 8652:2005(E) Ed. 3, Section 6: Subprograms
  3. Ada Reference Manual, ISO/IEC 8652:2005(E) Ed. 3, Section 9: Tasks and Synchronization
  4. Ada Reference Manual, ISO/IEC 8652:2005(E) Ed. 3 Annex E: Distributed Systems
  5. Ada Reference Manual, ISO/IEC 8652:2005(E) Ed. 3, Section 12: Generic Units
  6. Ada Reference Manual, ISO/IEC 8652:2005(E) Ed. 3, 3.9 Tagged Types and Type Extensions
  7. Vak.ru
  8. ISO 1538:1984
  9. Vak.ru
  10. JSR 274
  11. CM.bell-labs.com
  12. Codeproject.com
  13. ECMA-334; ISO/IEC 23270:2006
  14. Softvelocity.com
  15. ECMA-367; ISO/IEC 25436:2006
  16. JSR 241
  17. . http://www.haskell.org/onlinereport/. Retrieved 2009-03-07.  Most Haskell implementations extend the Haskell 98 standard.
  18. Version releases are accompanied with a definitive Lua Reference Manual showing full syntax and semantics; a reference implementation, and a test suite. These are used to generate other Lua VM implementations and compilers such as Kahlua and LLVM-Lua.
  19. ISO/IEC 10514-1:1996
  20. GCC.GNU.org
  21. Cirrus: Aspect-oriented programming in Delphi Prism
  22. ISO 7185
  23. PHP Manual, Chapter 17. Functions
  24. PHP Manual, Chapter 19. Classes and Objects (PHP 5)
  25. Language changes are done using a formally documented procedure, starting with a Python Enhancement Proposal (PEP)s. Python version releases are accompanied with a Language Reference Manual showing syntax and semantics; a reference implementation, and test suite. These are used to generate other Python implementations such as Jython and IronPython.
  26. SMLNJ.org
  27. Unsafe operations are well isolated by a "Unchecked_" prefix.
  28. Dynamic type checking is used when type safety can not be determined staticly i.e. for tagged types (type extension / inheritance), numeric ranges and array bounds.
  29. with optional dynamic type casting (see dynamic cast)
  30. Safe, but supports unsafe code through an explicit declaration
  31. with optional dynamic type (see dynamic member lookup)
  32. a b c d e It is almost safe, unsafe features are not commonly used.
  33. The Go Programming Language Specification
  34. Sheng Liang, Gilad Bracha. Dynamic class loading in the Java virtual machine. Volume 33, Issue 10 of ACM SIGPLAN Notices, October 1998.
  35. dynamic checking of type extensions i.e. inherited types
  36. Developer.apple.com
  37. explicit for static types
  38. optional for formal and virtual procedures
  39. gcc can warn on unchecked error status. Newer versions of Visual Studio usually throw exceptions on failed I/O when using stdio.
  40. g++ can warn on unchecked error status. Newer versions of Visual Studio usually throw exceptions on failed I/O when using stdio.
  41. However, the common PrintStream and PrintWriter classes require explicit calls to checkError().
  42. Considerable error checking can be enabled optionally, but by default Perl is not failsafe.