Type Systems
Brief definitions
- Compatibility among composite types describes the behavior of functions 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 determines whether and when types are verified. Static checking occurs at compile-time. Dynamic checking occurs at run-time.
| Language | Type strength | Type safety | Type expression | Type compatibility among composites | Type checking |
|---|---|---|---|---|---|
| ActionScript 3.0 | strong | safe | implicit with optional explicit typing | static | |
| Ada | strong | safe | explicit | name-based | partially dynamic |
| Aldor | strong | unsafe | implicit | static | |
| 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 | weak | unsafe | explicit | name-based | static |
| C++ (ISO/IEC 14882) | strong | unsafe | explicit | name-based | static |
| C# | strong | safe | implicit with optional explicit typing | name-based | static |
| 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 | explicit | name-based | static |
| Dylan | strong | safe | dynamic | ||
| Eiffel | strong | safe | name-based | static | |
| Erlang | strong | safe | implicit | dynamic | |
| Euphoria | strong | safe | explicit, implicit with objects | name-based | static, dynamic with objects |
| F# | strong | safe | implicit | name-based | static |
| Falcon | strong | safe | implicit | property-based | dynamic |
| Forth | none | n/a | n/a | n/a | n/a |
| Fortran | strong | safe | explicit | name-based | static |
| Gambas | strong | safe | explicit | name-based | |
| GLBasic | strong | safe | explicit. Non-explicit declarations available through project options | name-based | static |
| Go | strong | safe | implicit with optional explicit typing | property-based | static |
| Gosu | strong | safe | partially implicit (local type inference) | name-based (subclassing) and property-based (structural) | static |
| GraphTalk | weak | ||||
| Groovy | strong | safe | implicit with optional explicit typing | dynamic with optional static typing | |
| Harbour | strong | safe | implicit with optional explicit typing | dynamic | |
| Haskell | strong | safe | implicit with optional explicit typing | property-based | static |
| haXe | strong | safe | implicit with optional explicit typing | name-based (subclassing) and property-based (structural) | static with optional dynamic typing |
| Io | strong | safe | implicit | dynamic | |
| ISLISP | strong | safe | dynamic | ||
| J | strong | safe | dynamic | ||
| Java | strong | safe | 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 | explicit | name-based | static |
| Modula-3 | strong | unsafe | explicit | property-based | static |
| Oberon | strong | safe | explicit | name-based | static and partially dynamic |
| Objective-C | weak | safe | explicit | name-based (subclassing) and property-based (protocols) | dynamic with optional static typing |
| OCaml | strong | safe | implicit with optional explicit typing | property-based | static |
| Object Pascal (Delphi) | strong | safe | explicit | name-based | static |
| Opa | strong | safe | implicit with optional explicit typing | property-based | static |
| Oxygene | strong | unsafe | implicit | static | |
| Oz | strong | safe | implicit | property-based | dynamic |
| Pascal | strong | unsafe | explicit | name-based | static |
| Perl 5 | weak | implicit | dynamic | ||
| Perl 6 | partially implicit | 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 | |
| RPG (IBM) | strong | unsafe | static | ||
| Ruby | strong | safe | implicit | property-based | dynamic |
| Rust | strong | safe | implicit with optional explicit typing | static with optional dynamic typing | |
| 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 | ||
| 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 | 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 | Type expression | Type compatibility among composites | Type checking |
Read more about this topic: Comparison Of Programming Languages
Famous quotes containing the words type and/or systems:
“There is a limit to the application of democratic methods. You can inquire of all the passengers as to what type of car they like to ride in, but it is impossible to question them as to whether to apply the brakes when the train is at full speed and accident threatens.”
—Leon Trotsky (18791940)
“What avails it that you are a Christian, if you are not purer than the heathen, if you deny yourself no more, if you are not more religious? I know of many systems of religion esteemed heathenish whose precepts fill the reader with shame, and provoke him to new endeavors, though it be to the performance of rites merely.”
—Henry David Thoreau (18171862)