Semantic casts: Contracts and structural subtyping in a nominalworld

Robert Bruce Findler, Matthew Flatt, Matthias Felleisen

Research output: Chapter in Book/Report/Conference proceedingConference contribution

4 Scopus citations

Abstract

Nominal subtyping forces programmers to explicitly state all of the subtyping relationships in the program. This limits component reuse, because programmers cannot anticipate all of the contexts in which a particular class might be used. In contrast, structural subtyping implicitly allows any type with appropriate structure to be used in a given context. Languagues with contracts exacerbate the problem. Since contracts are typically expressed as refinements of types, contracts in nominally typed languages introduce additional obstacles to reuse. To overcome this problem we show how to extend a nominally typed language with semantic casts that introduce a limited form of structural subtyping. The new language must dynamically monitor contracts, as new subtyping relationships are exploited via semantic casts. In addition, it must also track the casts to properly assign blame in case interface contract are violated.

Original languageEnglish (US)
Title of host publicationLecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics)
EditorsMartin Odersky
PublisherSpringer Verlag
Pages365-389
Number of pages25
ISBN (Electronic)354022159X, 9783540221593
DOIs
StatePublished - 2004
Event18th European Conference on Object-Oriented Programming, ECOOP 2004 - Oslo, Norway
Duration: Jul 14 2004Jul 18 2004

Publication series

NameLecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics)
Volume3086
ISSN (Print)0302-9743
ISSN (Electronic)1611-3349

Other

Other18th European Conference on Object-Oriented Programming, ECOOP 2004
Country/TerritoryNorway
CityOslo
Period7/14/047/18/04

ASJC Scopus subject areas

  • Theoretical Computer Science
  • General Computer Science

Fingerprint

Dive into the research topics of 'Semantic casts: Contracts and structural subtyping in a nominalworld'. Together they form a unique fingerprint.

Cite this