Abstract
Programs written in scripting languages employ idioms that confound conventional type systems. In this paper, we highlight one important set of related idioms: the use of local control and state to reason informally about types. To address these idioms, we formalize run-time tags and their relationship to types, and use these to present a novel strategy to integrate typing with flow analysis in a modular way. We demonstrate that in our separation of typing and flow analysis, each component remains conventional, their composition is simple, but the result can handle these idioms better than either one alone.
Chapter PDF
References
Anderson, C., Giannini, P., Drossopoulou, S.: Towards type inference for javaScript. In: Gao, X.-X. (ed.) ECOOP 2005. LNCS, vol. 3586, pp. 428–452. Springer, Heidelberg (2005)
Crary, K., Weirich, S., Morrisett, G.: Intentional polymorphism in type-erasure semantics. In: ACM SIGPLAN International Conference on Functional Programming (1998)
Flanagan, C., Felleisen, M.: Componential set-based analysis. In: ACM SIGPLAN Conference on Programming Language Design and Implementation (1997)
Flanagan, C., Flatt, M., Krishnamurthi, S., Weirich, S., Felleisen, M.: Catching bugs in the web of program invariants. In: ACM SIGPLAN Conference on Programming Language Design and Implementation (1996)
Furr, M., An, J.D., Foster, J.S., Hicks, M.: Static type inference for Ruby. In: ACM Symposium on Applied Computing (2009)
Google JavaScript style guide, http://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml
Gosling, J., Joy, B., Steele, J.G.L., Bracha, G.: The Java Language Specification, 3rd edn. Addison Wesley, Reading (2005)
Guha, A., Saftoiu, C., Krishnamurthi, S.: The essence of javaScript. In: D’Hondt, T. (ed.) ECOOP 2010. LNCS, vol. 6183, pp. 126–150. Springer, Heidelberg (2010)
Harper, R., Mitchell, J.C.: On the type structure of Standard ML. ACM Transactions on Programming Languages and Systems 15(2) (1993)
Heidegger, P., Thiemann, P.: Recency types for dynamically-typed, object-based languages: Strong updates for JavaScript. In: ACM SIGPLAN International Workshop on Foundations of Object-Oriented Languages (2009)
Heintze, N.: Control-flow analysis and type systems. In: International Static Analysis Symposium (1995)
Henglein, F., Rehof, J.: Safe polymorphic type inference for a dynamically typed language: Translating Scheme to ML. In: ACM SIGPLAN International Conference on Functional Programming (1995)
Jensen, S.H., Møller, A., Thiemann, P.: Type analysis for JavaScript. In: International Static Analysis Symposium (2009)
Jensen, S.H., Møller, A., Thiemann, P.: Interprocedural analysis with lazy propagation. In: International Static Analysis Symposium (2010)
Kildall, G.A.: A unified approach to global program optimization. In: ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (1973)
Meunier, P., Findler, R.B., Felleisen, M.: Modular set-based analysis from contracts. In: ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (2006)
Mikhajlov, L., Sekerinski, E.: A study of the fragile base class problem. In: European Conference on Object-Oriented Programming (1998)
Nielson, F., Nielson, H.R.: Type and effect systems. In: Olderog, E.-R., Steffen, B. (eds.) Correct System Design. LNCS, vol. 1710, p. 114. Springer, Heidelberg (1999)
Palsberg, J., O’Keefe, P.: A type system equivalent to flow analysis. In: ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (1995)
Pierce, B.C.: Types and Programming Languages. MIT Press, Cambridge (2002)
Sabry, A., Felleisen, M.: Reasoning about programs in continuation-passing style. LISP and Symbolic Computation 6(3) (1993)
Shivers, O.: Control-Flow Analysis of Higher-Order Languages. PhD thesis, Carnegie Mellon University (1991)
Tobin-Hochstadt, S., Felleisen, M.: The design and implementation of Typed Scheme. In: ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (2008)
Tobin-Hochstadt, S., Felleisen, M.: Logical types for untyped languages. In: ACM SIGPLAN International Conference on Functional Programming (2010)
Wright, A.K., Cartwright, R.: A practical soft type system for Scheme. ACM Transactions on Programming Languages and Systems 19(1) (1997)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2011 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Guha, A., Saftoiu, C., Krishnamurthi, S. (2011). Typing Local Control and State Using Flow Analysis. In: Barthe, G. (eds) Programming Languages and Systems. ESOP 2011. Lecture Notes in Computer Science, vol 6602. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-19718-5_14
Download citation
DOI: https://doi.org/10.1007/978-3-642-19718-5_14
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-19717-8
Online ISBN: 978-3-642-19718-5
eBook Packages: Computer ScienceComputer Science (R0)