Comparison of programming languages

Article on other languages:

del.icio.us del.icio.us
Digg Digg
Furl Furl
Reddit Reddit
Rojo Rojo
Add to OnlyWire
This article is part of the
Programming Language Comparison
series.
General Comparison
Basic Syntax
Basic Instructions
Arrays
Associative arrays
String Operations
String Functions
List comprehension
Object-oriented programming
Object-oriented constructors
Database access

Evaluation strategy
List of "hello world" programs

Comparison of ALGOL 68 and C++
Compatibility of C and C++
Comparison of Pascal and Borland Delphi
Comparison of Pascal and C
Comparison of Java and C++
Comparison of Java and C#
Comparison of C# and Visual Basic .NET
Comparison of ABAP and Java


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.

Contents


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 Web, client-side imperative, object-oriented, event-driven Yes, ECMA
Ada Applications, Embedded and Realtime concurrent, distributed, generic, imperative, object-oriented Yes, ANSI, ISO, GOST 27831-88 [2]
ALGOL 58 Application imperative No
ALGOL 60 Application imperative Yes, ISO[3]
ALGOL 68 Application concurrent, imperative Yes, GOST_27974-88[4]
APL Application, Data processing array-oriented Yes, ISO
Assembly language General No
AutoIt Highly domain-specific, GUI automation(macros) procedural, imperative No
BASIC Application, Education procedural, imperative, Yes, ANSI, ISO
BeanShell Application, Scripting imperative, object-oriented, functional, reflective In progress, JCP[5]
BLISS System procedural No
Boo Application No
C System imperative Yes, ANSI C89, ISO C90/C99
C++ Application, System imperative, object-oriented, generic Yes, ISO
C# Application imperative, object-oriented, functional, generic, reflective Yes, ECMA, ISO[6]
Chrome Application imperative, object-oriented, generic No
Clean General functional, generic No
Clojure General functional No
COBOL Application, Business imperative, object-oriented Yes
ColdFusion Web Development procedural, object-oriented No
Common Lisp General imperative, functional, object-oriented Yes
Curl Rich Internet Applications event-driven, functional, imperative, object-oriented, generic, reflective No
D Application, System imperative, object-oriented, generic No
Dylan Application functional, object-oriented No
Eiffel Application imperative, object-oriented, generic Yes, ECMA, ISO[7]
Erlang Application, Distributed and Telecom functional, concurrent, distributed No
Factor stack-oriented No
FP functional No
F# Application functional, object-oriented, imperative, generic No
Forth General imperative, stack-oriented Yes, ANSI
Fortran Application, scientific and engineering imperative, procedural, object-oriented Yes
GraphTalk logic-oriented, object-oriented No
Groovy Application imperative, object-oriented, aspect-oriented No
Haskell Application functional, generic, lazy evaluation No
Io Application, Host-driven Scripting imperative, object-oriented No
J Data processing array-oriented, function-level, tacit No
Java Application imperative, object-oriented, generic, reflective No
JavaScript Web, client-side imperative, object-oriented, functional, reflective Yes, ECMA
Joy research functional, stack-oriented No
Lua Host-driven Scripting, Configuration, Data description; Web imperative, object-oriented, functional, aspect-oriented, reflective No[8]
Mathematica Highly domain-specific, Math functional, procedural No
MATLAB M-code Highly domain-specific, Math imperative, object-oriented No
Modula-2 Application imperative, generic Yes, ISO[9]
Modula-3 Application imperative, object-oriented, generic No
Oberon Application, System imperative, object-oriented No
Objective-C Application imperative, object-oriented, reflective Yes
Objective Caml Application object-oriented, functional, imperative, generic No
Object Pascal (Delphi) Application imperative, object-oriented, generic, event-driven No
Oz Education logic, functional, imperative, object-oriented, concurrent No
Pascal Application, Education imperative, procedural Yes, ISO[10]
Perl Application, Text processing, Scripting, Web imperative, procedural, reflective, functional, object-oriented, generic No
PHP Web, server-side imperative, procedural, object-oriented, reflective No
PL/I Application, COBOL's and Fortran's original domain imperative, object-oriented Yes
Prolog Application, Artificial intelligence logic Yes, ISO
Python Application, Scripting, Web imperative, object-oriented, functional, aspect-oriented, reflective No[11]
REALbasic Application
RPG Application
Ruby Application, Scripting, Web imperative, object-oriented, aspect-oriented, reflective No
S Application, Statistics imperative, procedural, functional, object-oriented No
S-Lang Application, Scripting, Numerical imperative, procedural No
Scala Application, Education object-oriented, functional, generic No
Scheme General, Education functional
Smalltalk Application, Education object-oriented, concurrent, event-driven, imperative, declarative Yes, ANSI
SNOBOL Text processing
Tcl Application, Scripting imperative, procedural, event-driven No
Visual Basic Application, Education component-oriented, event-driven No
Visual Basic .NET Application, Education object-oriented, event-driven No
Visual Prolog Application logical, object-oriented, functional, event-driven, imperative, declarative No
Windows PowerShell Administration imperative, object-oriented, functional, pipeline, reflective No
XL concept programming, imperative (by default), object-oriented (multiple models) No
Language Intended use Paradigm(s) Standardized?

Type systems

Language Type strength Type safety Expression of types Compatibility among composite types Type checking
ActionScript 3.0 strong safe static
Ada strong unsafe1 explicit name based static
ALGOL 58 strong safe static
ALGOL 60 strong safe static
ALGOL 68 strong safe property based static or dynamic (tagged union)
APL strong safe dynamic
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 weak unsafe explicit name based static
C++ (ISO/IEC 14882) strong unsafe explicit name based static with optional dynamic type casting (see dynamic_cast)
C# strong unsafe1 explicit name based partially dynamic
Clean strong implicit static
Clojure strong safe dynamic
COBOL strong static
ColdFusion strong safe implicit dynamic
Common Lisp strong safe dynamic
Curl strong safe name based
D strong unsafe1 explicit name based static
Dylan strong safe dynamic
Eiffel strong safe name based static
Erlang strong dynamic
F# strong safe implicit name based static
Forth none n/a n/a n/a n/a
Fortran strong safe name based static
GraphTalk weak
Groovy strong safe implicit dynamic
Haskell strong safe implicit with optional explicit typing property based static
Io strong dynamic
J strong safe dynamic
Java strong safe explicit name based static
JavaScript weak implicit dynamic
Joy strong safe dynamic
Lua strong safe implicit dynamic
Mathematica strong dynamic
MATLAB M-code dynamic
Modula-2 strong unsafe1 explicit property based static
Modula-3 strong unsafe1 explicit property based static
Oberon strong safe explicit static
Objective-C weak explicit static
Objective Caml strong safe implicit property based static
Object Pascal (Delphi) strong unsafe1 explicit name based static
Oxygene strong unsafe implicit static
Oz dynamic
Pascal strong unsafe1 explicit name based static
Perl 5 weak implicit dynamic
Perl 6 partially implicit (explicit for static types) dynamic with optional static typing
PHP weak implicit dynamic
Prolog strong dynamic
Python strong safe implicit property based dynamic
Ruby strong safe implicit property based dynamic
S strong dynamic
S-Lang strong safe implicit dynamic
Scala strong partially implicit static
Scheme strong dynamic (latent)
Smalltalk strong safe implicit dynamic
Tcl dynamic
Visual Basic strong safe explicit name based static
Visual Basic .NET strong unsafe1 explicit static
Visual Prolog strong safe 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

1It is almost safe, unsafe features are not commonly used.

Expressiveness

Language Statements ratio[12] Lines ratio[13]
C 1 1
C++ 2.5 1
Fortran 2.5 0.8
Java 2.5 1.5
Perl 6 6
Smalltalk 6 6.25
Python 6 6.5

The literature on programming languages contains an abundance of informal claims about their relative expressive power, but there's no framework for formalizing such statements nor for deriving interesting consequences.[14] This chart provides two measures of expressiveness from two different sources. An additional measure of expressiveness, in GZip bytes, can be found with the Compare to tool on the The Computer Language Benchmarks Game.

Benchmarks

Benchmarks are designed to mimic a particular type of workload on a component or system. The computer programs used for compiling some of the benchmark data in this section may not have been fully optimized, and the relevance of the data is disputed. The most accurate benchmarks are those that are customized to your particular situation. Other people's benchmark data may have some value to others, but proper interpretation brings many challenges. See this page about flawed benchmarks and comparisons. The Computer Language Benchmarks Game site contains a large number of micro-benchmarks of reader-contributed code snippets, with an interface that generates various charts and tables comparing specific programming languages and types of tests.

See also

References

  1. ^ As of May 2006 Diarmuid Pigott's Encyclopedia of Computer Languages hosted at Murdoch University, Australia lists 8512 computer languages.
  2. ^ http://vak.ru/lib/exe/fetch.php/book/gost/pdf/gost-27831-88.pdf
  3. ^ ISO 1538:1984
  4. ^ http://vak.ru/lib/exe/fetch.php/book/gost/pdf/gost-27974-88.pdf
  5. ^ JSR 274
  6. ^ ECMA-334; ISO/IEC 23270:2006
  7. ^ ECMA-367; ISO/IEC 25436:2006
  8. ^ 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.
  9. ^ ISO/IEC 10514-1:1996
  10. ^ ISO 7185
  11. ^ 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.
  12. ^ Data from Code Complete. The Statements ratio column "shows typical ratios of source statements in several high-level languages to the equivalent code in C. A higher ratio means that each line of code in the language listed accomplishes more than does each line of code in C.
  13. ^ The ratio of line count tests won by each language to the number won by C when using the Compare to feature at http://shootout.alioth.debian.org/debian/c.php. Last updated May, 2006. C gcc was used for C, C++ g++ was used for C++, Fortran G95 was used for Fortran, Java JDK Server was used for Java, and Smalltalk GST was used for Smalltalk.
  14. ^ From On the Expressive Power of Programming Languages, Matthias Felleisen, ESOP '90 3rd European Symposium on Programming.

Further reading

  • Cezzar, Ruknet. A Guide to Programming Languages: Overview and Comparison. ISBN 978-0890068120. 

External links

This article is from Wikipedia. All text is available under the terms of the GNU Free Documentation License.


Giant Panda

Mercedes Car
James Bond Guide
This site monitored by SitePinger.net