IT Updates: Comparison of programming languages

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 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],
APL Application, Data processing array-oriented, tacit 1989, ISO
Assembly language General imperative 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]
Clean General functional, generic No
Clojure General functional No
CLU General imperative, procedural, object-oriented, generic No
COBOL Application, Business imperative, object-oriented 1960
ColdFusion (CFML) Web Development procedural, object-oriented No
Common Lisp General imperative, functional, object-oriented 1994, ANSI
Comal F-73 Education imperative, procedural No
Comal 80 Education imperative, procedural No
Curl imperative, event-driven, functional, 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 2005, ECMA, ISO[14]
Erlang Application, Distributed and 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, scientific and engineering imperative, procedural, object-oriented, generic 1966, ANSI 66, ANSI 77, MIL-STD-1753, ISO 90, ISO 95, ISO 2003
Game Maker Language Application, games imperative, object-oriented, event-driven No
Go Application, System concurrent, imperative No
GraphTalk logic-oriented, object-oriented No
Groovy Application, Web imperative, object-oriented, aspect-oriented In progress, JCP[15]
Haskell Application functional, generic, lazy evaluation 1998, Haskell 98[16]
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 Unknown
Lua Embedded scripting; Application imperative, object-oriented, functional, aspect-oriented, reflective No[17]
Mathematica Highly domain-specific, Math procedural, functional No
MATLAB M-code Highly domain-specific, Math imperative, object-oriented No
Modula-2 Application; System imperative, generic 1996, ISO[18]
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[19]
Objective Caml Application imperative, object-oriented, functional, generic No
Object Pascal (Delphi) Application imperative, object-oriented, generic, event-driven, reflective, aspect-oriented[20] 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[21]
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[22], object-oriented[23], reflective No
PL/I Application, COBOL‘s and Fortran‘s original domain imperative, object-oriented 1969
Prolog Application, Artificial intelligence logic 1995, ISO
Python General, Application, Scripting, Web imperative, object-oriented, functional, aspect-oriented, reflective No[24]
REALbasic Application Unknown
REBOL Distributed computing imperative, object-oriented, functional, dialected No
RPG Application Unknown
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 computing 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 Unknown
Standard ML Application imperative, functional, generic 1997, SML ’97[25]
Tcl Application, Scripting imperative, procedural, event-driven No
TDL Bussineess Application Development,Extending Capabilities of Tally.ERP9[26] imperative, concept programming, object-oriented Yes,,Tally Developer
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?

[edit] 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 structure of its intended type.[clarification needed]
  • 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 static
Ada strong mostly safe [TS 1] explicit name-based partially dynamic [TS 2]
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
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 [TS 3]
C# strong safe[TS 4] explicit name-based static [TS 5]
Clean strong safe implicit static
Clojure strong safe implicit with optional explicit typing dynamic
COBOL strong static
ColdFusion strong safe implicit dynamic
Common Lisp strong safe implicit with optional explicit typing dynamic
Curl strong safe name-based
D strong unsafe[TS 6] 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
Go[27] strong safe implicit with optional explicit typing property-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[28] 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[TS 6] explicit name-based static
Modula-3 strong unsafe[TS 6] explicit property-based static
Oberon strong safe explicit name-based static and partially dynamic[TS 7]
Objective-C weak explicit static and dynamic[29][clarification needed]
Objective Caml strong safe implicit with optional explicit typing property-based static
Object Pascal (Delphi) strong unsafe[TS 6] explicit name-based static
Oxygene strong unsafe implicit static
Oz strong safe implicit property-based dynamic
Pascal strong unsafe[TS 6] explicit name-based static
Perl 5 weak implicit dynamic
Perl 6 partially implicit [TS 8] dynamic with optional static typing
PHP weak implicit dynamic
Prolog strong 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 partially implicit static
Scheme strong implicit dynamic (latent)
Simula strong safe static [TS 9]
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[TS 6] 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. ^ Unsafe operations are well isolated by a “Unchecked_” prefix.
  2. ^ 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.
  3. ^ with optional dynamic type casting (see dynamic cast)
  4. ^ Safe, but supports unsafe code through an explicit declaration
  5. ^ with optional dynamic type (see dynamic member lookup)
  6. ^ a b c d e f It is almost safe, unsafe features are not commonly used.
  7. ^ dynamic checking of type extensions i.e. inherited types
  8. ^ explicit for static types
  9. ^ optional for formal and virtual procedures

[edit] 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 [FSIO 1]
C++ No [FSIO 2]
C# Yes
D Yes ?
Erlang Yes
Haskell Yes
Java Yes
Lua No (some functions do not warn or throw exceptions)
Mathematica ?
Objective Caml Yes (exceptions)
Object Pascal (Delphi) Some
Perl No [FSIO 3]
Python Yes
Ruby Yes
S ?
Scala Yes ?
Standard ML Yes ?
Tcl No
Visual Basic Yes
Visual Prolog Yes
Language Failsafe I/O
  1. ^ gcc can warn on unchecked error status. Newer versions of Visual Studio usually throw exceptions on failed I/O when using stdio.
  2. ^ g++ can warn on unchecked error status. Newer versions of Visual Studio usually throw exceptions on failed I/O when using stdio.
  3. ^ Considerable error checking can be enabled optionally, but by default Perl is not failsafe.

[edit] Expressiveness

Language Statements ratio[30] Lines ratio[31]
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 is no framework for formalizing such statements nor for deriving interesting consequences.[32] This chart provides two measures of expressiveness from two different sources. An additional measure of expressiveness, in GZip bytes, can be found on the Computer Language Benchmarks Game [33]

[edit] 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.

[edit] Time line of specific language comparisons


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s