License
When quoting this document, please refer to the following
DOI: 10.4230/LIPIcs.ECOOP.2015.52
URN: urn:nbn:de:0030-drops-52173
URL: http://drops.dagstuhl.de/opus/volltexte/2015/5217/
Go to the corresponding LIPIcs Volume Portal


Vekris, Panagiotis ; Cosman, Benjamin ; Jhala, Ranjit

Trust, but Verify: Two-Phase Typing for Dynamic Languages

pdf-format:
7.pdf (0.7 MB)


Abstract

A key challenge when statically typing so-called dynamic languages is the ubiquity of value-based overloading, where a given function can dynamically reflect upon and behave according to the types of its arguments. Thus, to establish basic types, the analysis must reason precisely about values, but in the presence of higher-order functions and polymorphism, this reasoning itself can require basic types. In this paper we address this chicken-and-egg problem by introducing the framework of two-phased typing. The first "trust" phase performs classical, i.e. flow-, path- and value-insensitive type checking to assign basic types to various program expressions. When the check inevitably runs into "errors" due to value-insensitivity, it wraps problematic expressions with DEAD-casts, which explicate the trust obligations that must be discharged by the second phase. The second phase uses refinement typing, a flow- and path-sensitive analysis, that decorates the first phase's types with logical predicates to track value relationships and thereby verify the casts and establish other correctness properties for dynamically typed languages.

BibTeX - Entry

@InProceedings{vekris_et_al:LIPIcs:2015:5217,
  author =	{Panagiotis Vekris and Benjamin Cosman and Ranjit Jhala},
  title =	{{Trust, but Verify: Two-Phase Typing for Dynamic Languages}},
  booktitle =	{29th European Conference on Object-Oriented Programming (ECOOP 2015)},
  pages =	{52--75},
  series =	{Leibniz International Proceedings in Informatics (LIPIcs)},
  ISBN =	{978-3-939897-86-6},
  ISSN =	{1868-8969},
  year =	{2015},
  volume =	{37},
  editor =	{John Tang Boyland},
  publisher =	{Schloss Dagstuhl--Leibniz-Zentrum fuer Informatik},
  address =	{Dagstuhl, Germany},
  URL =		{http://drops.dagstuhl.de/opus/volltexte/2015/5217},
  URN =		{urn:nbn:de:0030-drops-52173},
  doi =		{10.4230/LIPIcs.ECOOP.2015.52},
  annote =	{Keywords: Dynamic Languages, Type Systems, Refinement Types, Intersection Types, Overloading}
}

Keywords: Dynamic Languages, Type Systems, Refinement Types, Intersection Types, Overloading
Seminar: 29th European Conference on Object-Oriented Programming (ECOOP 2015)
Issue Date: 2015
Date of publication: 26.06.2015


DROPS-Home | Fulltext Search | Imprint Published by LZI