Flow-sensitive typing: Difference between revisions

Content deleted Content added
Implementations: Added Kotlin and references for all languages (edited with ProveIt)
Yobot (talk | contribs)
m WP:CHECKWIKI error fixes using AWB (11971)
Line 1:
{{Type systems}}
 
In [[programming language theory]], '''flow-sensitive typing''' (or '''flow typing''') is a [[type system]] where the type of a [[Variable (computer science)|variable]] is determined by the [[control flow]].
 
Classically in [[Static typing|statically typed languages]], a variable is bound to a single type during its lifetime. However, in flow-sensitive typing, a variable's type may change inside the body of a [[Method (computer programming)|method]], while traversing control flow statements. The type is determined by using [[type inference]] and type information is carried using [[algebraic data type]]s.
Line 58:
[[Whiley (programming language)|Whiley]], created by David J. Pearce, was the first language to make use of flow-sensitive typing in 2009.<ref>{{cite web | url=http://whiley.org/2010/09/22/on-flow-sensitive-types-in-whiley/ | title=On Flow-Sensitive Types in Whiley | publisher=whiley.org | date=22 September 2010 | accessdate=11 March 2016 | author=David J. Pearce}}</ref><ref>{{cite web | url=http://whiley.org/guide/typing/flow-typing/ | title=Whiley - Flow Typing | publisher=whiley.org | date=8 April 2012 | accessdate=11 March 2016 | author=David J. Pearce}}</ref>
 
Since this introduction, other languages have made use of it, namely [[Ceylon (programming language)|Ceylon]],<ref>{{cite web | url=http://ceylon-lang.org/documentation/1.2/introduction/#typesafe_null_and_flow_sensitive_typing | title=Ceylon - Quick introduction - Typesafe null and flow-sensitive typing | publisher=ceylon-lang.org | accessdate=11 March 2016}}</ref>, [[Kotlin]],<ref>{{cite web | url=https://kotlinlang.org/docs/reference/null-safety.html | title=Null Safety | publisher=kotlinlang.org | accessdate=11 March 2016}}</ref><ref>{{cite web | url=https://kotlinlang.org/docs/reference/typecasts.html | title=Type Checks and Casts | publisher=kotlinlang.org | accessdate=11 March 2016}}</ref>, [[TypeScript]]<ref>{{cite web | url=https://blogs.msdn.microsoft.com/typescript/2014/11/18/typescript-1-4-sneak-peek-union-types-type-guards-and-more | title=TypeScript 1.4 sneak peek: union types, type guards, and more | publisher=blogs.msdn.microsoft.com | date=18 November 2014 | accessdate=11 March 2016 | author=Ryan Cavanaugh}}</ref> and [[Facebook]] Flow.<ref>{{cite web | url=https://code.facebook.com/posts/1505962329687926/flow-a-new-static-type-checker-for-javascript | title=Flow, a new static type checker for JavaScript | publisher=code.facebook.com | date=18 November 2014 | accessdate=11 March 2016 | authors=Avik Chaudhuri, Basil Hosmer, Gabriel Levi}}</ref>.
 
==External references==
<references />
 
 
{{Data types}}