Typed and untyped languages

From Wikipedia, the free encyclopedia

In computer science, some programming languages are typed and some are untyped. Regardless of static or dynamic checking, a language can be strongly typed or weakly typed. This article categorizes languages by a type system.

Languages can perform type-checking either statically or dynamically. Statically implies the type-checking is done on code compilaton. Dynamic refers to type-checking being done at run-time. See Dynamically_typed and Static_typing#Static and dynamic type checking in practice. For a definition of strong and weak languages, see Strongly-typed_programming_language.

The syntax of the following headings is of <compilation time, type checking level>. Static and dynamic are the times (either at compile or interpretation). Strong and weak are the extent to which type checking is enforced and how "strict" the type checker is.


Contents

[edit] Static, strong

  • Haskell (type-inference)
  • ML (type-inference)
  • Java (type declaration -- also has casting)

[edit] Static, weak

  • C (type declaration -- also, plenty of ways to get around the type-system and do something type-unsafe!)
  • C++ (type declaration -- has casts and implicit conversions though fewer than C)

[edit] Dynamic, strong

[edit] Dynamic, weak

  • Perl (loves to do implicit conversions ....)
  • Tcl
  • PHP
  • Corn (no types at all)

[edit] See also