Abstract
Static type systems are usually conservative. Therefore, many interesting programs are rejected by the static type system, even though they may execute without errors. Dynamic type systems allow such ill-typed programs to run, at the cost of run-time errors. The cause of runtime errors is often far removed from the place where the type errors are raised, making the program hard to debug. We present a novel typing discipline called blame prediction which transforms programs in order to detect runtime type errors as soon as they are guaranteed to happen. These type errors relate the future type error with its cause, aiding in debugging. As a proof of concept, we have applied blame prediction to a functional Scheme-like language and evaluated our system against soft typing.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Cartwright, R., Fagan, M.: Soft typing. In: Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation, pp. 278–292 (1991)
Aiken, A., Wimmers, E.L., Lakshman, T.K.: Soft typing with conditional types. In: Proceedings of the 21st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pp. 163–173 (1994)
Flanagan, C., Felleisen, M.: A new way of debugging lisp programs. 40th Anniversary of Lisp (Lisp in the Mainstream) (1998)
Guha, A., Saftoiu, C., Krishnamurthi, S.: Typing Local Control and State Using Flow Analysis. In: Proceedings of the 20th European Symposium on Programming, pp. 256–275 (2011)
Furr, M., An, J., Foster, J., Hicks, M.: Static type inference for Ruby. In: Proceedings of the ACM Symposium on Applied Computing, pp. 1859–1866 (2009)
Felleisen, M., Hieb, R.: The revised report on the syntactic theories of sequential control and state. Theoretical Computer Science 103(2), 235–271 (1992)
Sabry, A., Felleisen, M.: Reasoning about programs in continuation-passing style. LISP and Symbolic Computation 6(3-4), 289–360 (1993)
Flanagan, C., Sabry, A., Duba, B.F., Felleisen, M.: The essence of compiling with continuations. In: Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation, pp. 237–247 (1993)
Wright, A.K., Cartwright, R.: A practical soft type system for Scheme. In: Proceedings of the ACM Conference on LISP and Functional Programming, pp. 250–262 (July 1994)
Gabriel, R.P., Masinter, L.M.: Performance of Lisp systems. In: Proceedings of the ACM Symposium on LISP and Functional Programming, pp. 123–142 (1982)
Siek, J.G., Taha, W.: Gradual typing for functional languages. In: Proceedings of the Workshop on Scheme and Functional Programming, pp. 81–92 (2006)
Tobin-Hochstadt, S., Felleisen, M.: Interlanguage migration: from scripts to programs. In: Proceedings of the 21st ACM International Conference on Object Oriented Programming Systems Languages and Applications, pp. 964–974 (2006)
Findler, R.B., Felleisen, M.: Contracts for higher-order functions. In: Proceedings of the 7th International Conference on Functional Programming, pp. 48–59 (2002)
Peyton Jones, S., Vytiniotis, D., Magalhães, J.P.: Equality proofs and deferred type errors: A compiler pearl. In: Proceedings of the 17th International Conference on Functional Programming, pp. 341–352 (2012)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2014 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Harnie, D., Scholliers, C., De Meuter, W. (2014). Blame Prediction. In: McCarthy, J. (eds) Trends in Functional Programming. TFP 2013. Lecture Notes in Computer Science, vol 8322. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-45340-3_6
Download citation
DOI: https://doi.org/10.1007/978-3-642-45340-3_6
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-45339-7
Online ISBN: 978-3-642-45340-3
eBook Packages: Computer ScienceComputer Science (R0)