Well-Typed Programs Can’t Be Blamed

  • Philip Wadler
  • Robert Bruce Findler
Part of the Lecture Notes in Computer Science book series (LNCS, volume 5502)

Abstract

We introduce the blame calculus, which adds the notion of blame from Findler and Felleisen’s contracts to a system similar to Siek and Taha’s gradual types and Flanagan’s hybrid types. We characterise where positive and negative blame can arise by decomposing the usual notion of subtype into positive and negative subtypes, and show that these recombine to yield naive subtypes. Naive subtypes previously appeared in type systems that are unsound, but we believe this is the first time naive subtypes play a role in establishing type soundness.

References

  1. 1.
    Abadi, M., Cardelli, L., Pierce, B., Plotkin, G.: Dynamic typing in a statically typed language. ACM Trans. Prog. Lang. Syst. 13(2), 237–268 (1991)CrossRefGoogle Scholar
  2. 2.
    Bracha, G.: Pluggable type systems. In: OOPSLA 2004 Workshop on Revival of Dynamic Languages (October 2004)Google Scholar
  3. 3.
    Findler, R., Blume, M.: Contracts as pairs of projections. In: Hagiya, M., Wadler, P. (eds.) FLOPS 2006. LNCS, vol. 3945, pp. 226–241. Springer, Heidelberg (2006)CrossRefGoogle Scholar
  4. 4.
    Findler, R.B., Felleisen, M.: Contracts for higher-order functions. In: ACM International Conference on Functional Programming (ICFP) (October 2002)Google Scholar
  5. 5.
    Flanagan, C.: Hybrid type checking. In: ACM Symposium on Principles of Programming Languages (POPL) (Janurary 2006)Google Scholar
  6. 6.
    Gray, K.E., Findler, R.B., Flatt, M.: Fine-grained interoperability through contracts and mirrors. In: ACM Conference on Object-Oriented Programming: Systems, Languages, and Applications (OOPSLA), pp. 231–246 (2005)Google Scholar
  7. 7.
    Gronski, J., Flanagan, C.: Unifying hybrid types and contracts. In: Trends in Functional Programming (TFP) (April 2007)Google Scholar
  8. 8.
    Gronski, J., Knowles, K., Tomb, A., Freund, S.N., Flanagan, C.: Sage: Hybrid checking for flexible specifications. In: Workshop on Scheme and Functional Programming (September 2006)Google Scholar
  9. 9.
    Henglein, F.: Dynamic typing: Syntax and proof theory. Sci. Comput. Programming 22(3), 197–230 (1994)MATHCrossRefMathSciNetGoogle Scholar
  10. 10.
    Matthews, J., Findler, R.B.: Operational semantics for multi-language programs. In: ACM Symposium on Principles of Programming Languages (POPL) (Janurary 2007)Google Scholar
  11. 11.
    Meijer, E.: Static typing where possible, dynamic typing where needed. In: OOPSLA 2004 Workshop on Revival of Dynamic Languages (October 2004)Google Scholar
  12. 12.
    Meyer, B.: Object-Oriented Software Construction. Prentice Hall, Englewood Cliffs (1988)Google Scholar
  13. 13.
    Ou, X., Tan, G., Mandelbaum, Y., Walker, D.: Dynamic typing with dependent types. In: IFIP International Conference on Theoretical Computer Science (August 2004)Google Scholar
  14. 14.
    Siek, J., Garcia, R., Taha, W.: Exploring the design space of higher-order casts. In: Castagna, G. (ed.) ESOP 2009. LNCS, vol. 5502, pp. 17–31. Springer, Heidelberg (2009)Google Scholar
  15. 15.
    Siek, J.G., Taha, W.: Gradual typing for functional languages. In: Workshop on Scheme and Functional Programming (September 2006)Google Scholar
  16. 16.
    Thatte, S.: Type inference with partial types. In: Lepistö, T., Salomaa, A. (eds.) ICALP 1988. LNCS, vol. 317. Springer, Heidelberg (1988)Google Scholar
  17. 17.
    Tobin-Hochstadt, S., Felleisen, M.: Interlanguage migration: From scripts to programs. In: Dynamic Languages Symposium (DLS) (2006)Google Scholar
  18. 18.
    Tobin-Hochstadt, S., Felleisen, M.: The design and implementation of typed scheme. In: ACM Symposium on Principles of Programming Languages (POPL) (2008)Google Scholar
  19. 19.
    Wadler, P., Findler, R.B.: Well-typed programs can’t be blamed. In: Workshop on Scheme and Functional Programming (September 2007)Google Scholar
  20. 20.
    Wadler, P., Findler, R.B.: Well-typed programs can’t be blamed. Technical Report TR-2009-01, University of Chicago (2009)Google Scholar
  21. 21.
    Wright, A.K., Cartwright, R.: A practical soft typing system for Scheme. ACM Trans. Prog. Lang. Syst. 19(1) (1997)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2009

Authors and Affiliations

  • Philip Wadler
    • 1
  • Robert Bruce Findler
    • 2
  1. 1.University of Edinburgh 
  2. 2.University of Chicago 

Personalised recommendations