Including both static and dynamic typing in the same programming language

Including both static and dynamic typing in the same programming language

For access to this article, please select a purchase option:

Buy article PDF
(plus tax if applicable)
Buy Knowledge Pack
10 articles for £75.00
(plus taxes if applicable)

IET members benefit from discounts to all IET publications and free access to E&T Magazine. If you are an IET member, log in to your account and the discounts will automatically be applied.

Learn more about IET membership 

Recommend Title Publication to library

You must fill out fields marked with: *

Librarian details
Your details
Why are you recommending this title?
Select reason:
IET Software — Recommend this title to your library

Thank you

Your recommendation has been sent to your librarian.

Dynamic languages are becoming increasingly popular for different software development scenarios such as Web engineering, rapid prototyping or the construction of applications that require runtime adaptiveness. These languages are built on the idea of supporting reasoning about (and customising) program structure, behaviour and environment at runtime. The dynamism offered by dynamic languages is, however, counteracted by two main limitations: no early type error detection and fewer opportunities for compiler optimisations. To obtain the benefits of both dynamically and statically typed languages, the authors have designed the StaDyn programming language that provides both approaches. StaDyn keeps gathering-type information at compile time, even when dynamic variables are used. This type information is used to offer early type error detection, direct interoperation between static and dynamic codes and better runtime performance. Following the Separation of Concerns principle, it is possible to customise the trade-off between runtime flexibility of dynamic typing and safety, performance and robustness of static typing. A runtime performance assessment is presented to show an estimate of the benefits of combining dynamic and static typing in the same programming language.


    1. 1)
      • Programming ruby
    2. 2)
      • Agile web development with rails. A pragmatic guide
    3. 3)
      • The pragmatic programmer
    4. 4)
      • ECMA-357: ‘ECMAScript for XML (E4X) specification
    5. 5)
      • Ajax in action
    6. 6)
      • The Python Language Reference Manual
    7. 7)
      • The Zope Book
    8. 8)
      • Django, the Web framework for perfectionists with deadlines:, accessed September 2009
    9. 9)
      • Lua –an extensible extension language
    10. 10)
      • Ierusalimschy, R., de Figueiredo, L.H., Celes, W.: `The evolution Lua', Proc. 3rd ACM SIGPLAN Conf. on History of Programming Languages, 2007, p. 1–26
    11. 11)
      • The Pythius website:, accessed September 2009
    12. 12)
      • Böllert, K.: `On weaving aspects', Eur. Conf. on Object-Oriented Programming (ECOOP), Workshop on Aspect Oriented Programming, 1999, p. 301–302
    13. 13)
    14. 14)
      • JSR 223: ‘Scripting for the Java platform’.
    15. 15)
      • JSR 292: ‘Supporting dynamically typed languages on the Java platform’.
    16. 16)
      • ‘The Da Vinci Machine, a multi-language renaissance for the Java Virtual Machine architecture’. Sun Microsystems OpenJDK.
    17. 17)
      • Hugunin, J.: `Just Glue It! Ruby and the DLR in silverlight', MIX Conf., 2007
    18. 18)
      • New features in C# 4.0
    19. 19)
      • Types and programming languages
    20. 20)
      • Meijer, E., Drayton, P.: `Dynamic typing when needed: the end of the cold war between programming languages', Proc. OOPSLA Workshop on Revival of Dynamic Languages, 2004
    21. 21)
      • Dynamic typing in a statically typed language
    22. 22)
      • Abadi, M., Cardelli, L., Pierce, B.C., Plotkin, G.: `Dynamic typing in polymorphic languages', SRC Research Report 120, 1994, Digital
    23. 23)
      • Hürsch, W.L., Lopes, C.V.: `Separation of concerns', Technical Report UN-CCS-95-03, 1995, Northeastern University, Boston, USA
    24. 24)
      • Type systems
    25. 25)
      • Ortin, F.: `The StaDyn core type system', Technical Report, August 2009, Computer Science Department, University of Oviedo, available at
    26. 26)
      • ‘The C# 3.0 language specification’. Microsoft Developer Network,\%20Language\%20Specification.doc
    27. 27)
      • The definition of standard ML
    28. 28)
      • Hudak, P., Jones, S.P., Wadler, P.: `Report on the programming language Haskell version 1.1', Technical, 1991, Departments of Computer Science, University of Glasgow and Yale University
    29. 29)
      • Basic Polymorphic Typechecking
    30. 30)
      • A theory of type polymorphism in programming
    31. 31)
      • Efficiently computing static single assignment form and the control dependence graph
    32. 32)
      • Design patterns: elements of reusable object-oriented software
    33. 33)
      • Odersky, M., Cremet, V., Röckl, C., Zenger, M.: `A nominal theory of objects with dependent types', Eur. Conf. on Object-Oriented Programming, 2002, p. 201–224
    34. 34)
      • Objective ML: ‘An effective object-oriented extension to ML
    35. 35)
      • Freeman, T., Pfenning, F.: `Refinement types for ML', Proc. ACM SIGPLAN 1991 Conf. on Programming Language Design and Implementation, 1991, Toronto, Ontario, Canada, p. 268–277
    36. 36)
      • Plevyak, J., Chien, A.A.: `Precise concrete type inference for object-oriented languages', SIGPLAN Notices 29, 10, Proc. OOPSLA Conf., 1994, p. 324–340
    37. 37)
      • Pierce, B.C.: `Programming with intersection types, union types, and polymorphism', Technical Report CMU-CS-91-106, 1991, School of Computer Science, Carnegie Mellon University, Pittsburgh, PA
    38. 38)
      • Bracha, G.: `Pluggable type systems', OOPSLA Workshop on Revival of Dynamic Languages, October 2004
    39. 39)
      • Practical, pluggable types for a dynamic language
    40. 40)
      • Canning, P., Cook, W., Hill, W., Olthoff, W., Mitchell, J.C.: `F-bounded polymorphism for object-oriented programming', Proc. 4th Int. Conf. on Functional Programming Languages and Computer Architecture, 1989, p. 273–280
    41. 41)
      • Type inference with constrained types
    42. 42)
      • Landi, W., Ryder, B.G.: `A safe approximate algorithm for interprocedural pointer aliasing', Conf. on Programming Language Design and Implementation, 1992, p. 473–489
    43. 43)
      • Diwan, A., McKinley, K.S., Moss, J.E.B.: `Type-based alias analysis', SIGPLAN Conf. on Programming Language Design and Implementation, 1998, p. 106–117
    44. 44)
      • Emami, M., Ghiya, R., Hendren, L.: `Context-sensitive inter-procedural points-to analysis in the presence of function pointers', Proc. ACM SIGPLAN'94 Conf. on Programming Language Design and Implementation, 1994, p. 242–256
    45. 45)
      • Modern compiler implementation in ML
    46. 46)
      • Pattern-oriented software architecture, a system of patterns
    47. 47)
      • The definitive ANTLR reference: building domain-specific languages
    48. 48)
      • Programming language processors in Java: compilers and interpreters
    49. 49)
      • Design patterns for teaching type checking in a compiler construction course
    50. 50)
      • Optimising reflective primitives of dynamic languages
    51. 51)
      • Efficient virtual machine support of runtime structural reflection
    52. 52)
      • Bracha, G., Griswold, D.: `Strongtalk: typechecking smalltalk in a production environment', Proc. OOPSLA'93 Conf. on Object-Oriented Programming Systems, Languages and Applications, 1993, p. 215–230
    53. 53)
      • Smalltalk-80: the language and its implementation
    54. 54)
      • The Dylan reference manual: the definitive guide to the new object-oriented dynamic language
    55. 55)
      • The microsoft visual basic language specification
    56. 56)
      • Boo home page:, accessed September 2009
    57. 57)
      • Cartwright, R., Fagan, M.: `Soft typing', Proc. ACM SIGPLAN Conf. on Programming Language Design and Implementation, 1991
    58. 58)
      • Flanagan, C., Flatt, M., Krishnamurthi, S., Weirich, S., Felleisen, M.: `Catching bugs in the web of program invariants', Proc. ACM SIGPLAN Conf. on Programming Language Design and Implementation, 1996
    59. 59)
      • Thatte, S.: `Quasi-static typing', Proc. ACM Symp. on Principles of Programming Languages, 1990
    60. 60)
      • Flanagan, C., Freund, S.N., Tomb, A.: `Hybrid types, invariants, and refinements for imperative objects', Int. Workshop Foundations and Developments of Object-Oriented Languages, 2006
    61. 61)
      • Siek, J., Taha, W.: `Gradual typing for objects', Proc. 21st Eur. Conf. on Object-Oriented Programing, Lecture Notes In Computer Science, vol. 4609, 2007
    62. 62)
      • Siek, J., Vachharajani, M.: `Gradual typing with unification-based inference', Proc. Symp. on Dynamic Languages, 2008

Related content

This is a required field
Please enter a valid email address