Advertisement

Typing Local Control and State Using Flow Analysis

  • Arjun Guha
  • Claudiu Saftoiu
  • Shriram Krishnamurthi
Part of the Lecture Notes in Computer Science book series (LNCS, volume 6602)

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.

Keywords

Type System Flow Analysis Type Scheme Script Language Type Inference 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

References

  1. 1.
    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)CrossRefGoogle Scholar
  2. 2.
    Crary, K., Weirich, S., Morrisett, G.: Intentional polymorphism in type-erasure semantics. In: ACM SIGPLAN International Conference on Functional Programming (1998)Google Scholar
  3. 3.
    Flanagan, C., Felleisen, M.: Componential set-based analysis. In: ACM SIGPLAN Conference on Programming Language Design and Implementation (1997)Google Scholar
  4. 4.
    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)Google Scholar
  5. 5.
    Furr, M., An, J.D., Foster, J.S., Hicks, M.: Static type inference for Ruby. In: ACM Symposium on Applied Computing (2009)Google Scholar
  6. 6.
  7. 7.
    Gosling, J., Joy, B., Steele, J.G.L., Bracha, G.: The Java Language Specification, 3rd edn. Addison Wesley, Reading (2005)zbMATHGoogle Scholar
  8. 8.
    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)CrossRefGoogle Scholar
  9. 9.
    Harper, R., Mitchell, J.C.: On the type structure of Standard ML. ACM Transactions on Programming Languages and Systems 15(2) (1993)Google Scholar
  10. 10.
    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)Google Scholar
  11. 11.
    Heintze, N.: Control-flow analysis and type systems. In: International Static Analysis Symposium (1995)Google Scholar
  12. 12.
    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)Google Scholar
  13. 13.
    Jensen, S.H., Møller, A., Thiemann, P.: Type analysis for JavaScript. In: International Static Analysis Symposium (2009)Google Scholar
  14. 14.
    Jensen, S.H., Møller, A., Thiemann, P.: Interprocedural analysis with lazy propagation. In: International Static Analysis Symposium (2010)Google Scholar
  15. 15.
    Kildall, G.A.: A unified approach to global program optimization. In: ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (1973)Google Scholar
  16. 16.
    Meunier, P., Findler, R.B., Felleisen, M.: Modular set-based analysis from contracts. In: ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (2006)Google Scholar
  17. 17.
    Mikhajlov, L., Sekerinski, E.: A study of the fragile base class problem. In: European Conference on Object-Oriented Programming (1998)Google Scholar
  18. 18.
    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)CrossRefGoogle Scholar
  19. 19.
    Palsberg, J., O’Keefe, P.: A type system equivalent to flow analysis. In: ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (1995)Google Scholar
  20. 20.
    Pierce, B.C.: Types and Programming Languages. MIT Press, Cambridge (2002)zbMATHGoogle Scholar
  21. 21.
    Sabry, A., Felleisen, M.: Reasoning about programs in continuation-passing style. LISP and Symbolic Computation 6(3) (1993)Google Scholar
  22. 22.
    Shivers, O.: Control-Flow Analysis of Higher-Order Languages. PhD thesis, Carnegie Mellon University (1991)Google Scholar
  23. 23.
    Tobin-Hochstadt, S., Felleisen, M.: The design and implementation of Typed Scheme. In: ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (2008)Google Scholar
  24. 24.
    Tobin-Hochstadt, S., Felleisen, M.: Logical types for untyped languages. In: ACM SIGPLAN International Conference on Functional Programming (2010)Google Scholar
  25. 25.
    Wright, A.K., Cartwright, R.: A practical soft type system for Scheme. ACM Transactions on Programming Languages and Systems 19(1) (1997)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2011

Authors and Affiliations

  • Arjun Guha
    • 1
  • Claudiu Saftoiu
    • 1
  • Shriram Krishnamurthi
    • 1
  1. 1.Brown UniversityUSA

Personalised recommendations