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.
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.
Brief Definitions
| 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 |
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 |