Towards Hybrid and Reusable Type Inference for Dynamically-Typed Languages
Resumo
Type inference is a technique for automatically reconstructing types before program execution in the absence of explicit type annotations. While it has been adopted in many statically typed languages, applying type inference to dynamically-typed languages, poses challenges due to their runtime-oriented typing mechanisms. In this paper, we present HYPHE, a Hybrid Type Inference and Validation Framework for dynamically-typed languages, designed to combine within a single environment various approaches to type inference to leverage the strengths of each. HYPHE infers, stores, compares, and refines type information in a continuous loop integrated with developers. A preliminary evaluation in the Pharo Smalltalk environment indicates that combining multiple inference sources, as established in prior works, achieves broad type coverage while shifting computationally intensive analyses to offline processing and reusing accumulated inference data.Referências
Agesen, O. (1995). The cartesian product algorithm: Simple and precise type inference of parametric polymorphism. In Proceedings of the 9th European Conference on Object-Oriented Programming, ECOOP ’95, page 2–26, Berlin, Heidelberg. Springer-Verlag.
Aiken, A. and Murphy, B. (1991). Static type inference in a dynamically typed language. In Proceedings of the 18th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL ’91, page 279–290, New York, NY, USA. ACM.
Aycock, J. (2000). Aggressive type inference. International Python Conference.
Black, A. P., Ducasse, S., Nierstrasz, O., Pollet, D., Cassou, D., and Denker, M. (2009). Pharo by Example. Square Bracket Associates, Kehrsatz, Switzerland.
Bliznicenko, J. and Pergl, R. (2025). Combining type inference techniques for semi-automatic UML generation from pharo code. J. Comput. Lang., 82:101300.
Castagna, G., Laurent, M., and Nguy˜ên, K. (2024). Polymorphic type inference for dynamic languages. Proc. ACM Program. Lang., 8(POPL).
Gundry, A., McBride, C., and McKinna, J. (2010). Type inference in context. In Proceedings of MSFP ’10, page 43–54, New York, NY, USA. ACM.
Hyalinos (2025). Hyalinos: A transparent type inference framework for pharo smalltalk. [link]. Accessed: 2026-01-28.
Johnson, R. E. (1986). Type-checking smalltalk. In Conference Proceedings on Object-Oriented Programming Systems, Languages and Applications, OOPSLA ’86, page 315–321, New York, NY, USA. ACM.
Kazerounian, M., Ren, B. M., and Foster, J. S. (2020). Sound, heuristic type annotation inference for ruby. In Proceedings of the 16th ACM SIGPLAN International Symposium on Dynamic Languages, DLS 2020, page 112–125, New York, NY, USA. Association for Computing Machinery.
Kleinschmager, S., Robbes, R., Stefik, A., Hanenberg, S., and Tanter, E. (2012). Do static type systems improve the maintainability of software systems? an empirical study. In 2012 20th IEEE International Conference on Program Comprehension (ICPC), pages 153–162.
Milojković, N. (2017). Augmenting Type Inference with Lightweight Heuristics. PhD thesis, University of Bern.
Passerini, N., Tesone, P., and Ducasse, S. (2014). An extensible constraint-based type inference algorithm for object-oriented dynamic languages supporting blocks and generic types. In International Workshop on Smalltalk Technologies (IWST’14).
Pluquet, F., Marot, A., and Wuyts, R. (2009). Fast type reconstruction for dynamically typed programming languages. SIGPLAN Not., 44(12):69–78.
Safina, L. (2026). Hyalinos: From type inference to community knowledge. In Proceedings of the 34th IEEE/ACM International Conference on Program Comprehension (ICPC ’26), Rio de Janeiro, Brazil. ACM. Accepted for publication.
Safina, L., Blizničenko, J., and Pergl, R. (2025). Even lighter than lightweight: Augmenting type inference with primitive heuristics. In Proceedings of the International Workshop on Smalltalk Technologies (IWST), Gdańsk, Poland.
Suzuki, N. (1981). Inferring types in smalltalk. In Proceedings of the 8th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL ’81, page 187–199, New York, NY, USA. ACM.
Typeshed (2025). [link]. GitHub repository.
Wang, K., Li, T., Zhang, X., Wang, C., Sun, W., Liu, Y., and Shi, B. (2025). Software development life cycle perspective: A survey of benchmarks for code large language models and agents.
Aiken, A. and Murphy, B. (1991). Static type inference in a dynamically typed language. In Proceedings of the 18th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL ’91, page 279–290, New York, NY, USA. ACM.
Aycock, J. (2000). Aggressive type inference. International Python Conference.
Black, A. P., Ducasse, S., Nierstrasz, O., Pollet, D., Cassou, D., and Denker, M. (2009). Pharo by Example. Square Bracket Associates, Kehrsatz, Switzerland.
Bliznicenko, J. and Pergl, R. (2025). Combining type inference techniques for semi-automatic UML generation from pharo code. J. Comput. Lang., 82:101300.
Castagna, G., Laurent, M., and Nguy˜ên, K. (2024). Polymorphic type inference for dynamic languages. Proc. ACM Program. Lang., 8(POPL).
Gundry, A., McBride, C., and McKinna, J. (2010). Type inference in context. In Proceedings of MSFP ’10, page 43–54, New York, NY, USA. ACM.
Hyalinos (2025). Hyalinos: A transparent type inference framework for pharo smalltalk. [link]. Accessed: 2026-01-28.
Johnson, R. E. (1986). Type-checking smalltalk. In Conference Proceedings on Object-Oriented Programming Systems, Languages and Applications, OOPSLA ’86, page 315–321, New York, NY, USA. ACM.
Kazerounian, M., Ren, B. M., and Foster, J. S. (2020). Sound, heuristic type annotation inference for ruby. In Proceedings of the 16th ACM SIGPLAN International Symposium on Dynamic Languages, DLS 2020, page 112–125, New York, NY, USA. Association for Computing Machinery.
Kleinschmager, S., Robbes, R., Stefik, A., Hanenberg, S., and Tanter, E. (2012). Do static type systems improve the maintainability of software systems? an empirical study. In 2012 20th IEEE International Conference on Program Comprehension (ICPC), pages 153–162.
Milojković, N. (2017). Augmenting Type Inference with Lightweight Heuristics. PhD thesis, University of Bern.
Passerini, N., Tesone, P., and Ducasse, S. (2014). An extensible constraint-based type inference algorithm for object-oriented dynamic languages supporting blocks and generic types. In International Workshop on Smalltalk Technologies (IWST’14).
Pluquet, F., Marot, A., and Wuyts, R. (2009). Fast type reconstruction for dynamically typed programming languages. SIGPLAN Not., 44(12):69–78.
Safina, L. (2026). Hyalinos: From type inference to community knowledge. In Proceedings of the 34th IEEE/ACM International Conference on Program Comprehension (ICPC ’26), Rio de Janeiro, Brazil. ACM. Accepted for publication.
Safina, L., Blizničenko, J., and Pergl, R. (2025). Even lighter than lightweight: Augmenting type inference with primitive heuristics. In Proceedings of the International Workshop on Smalltalk Technologies (IWST), Gdańsk, Poland.
Suzuki, N. (1981). Inferring types in smalltalk. In Proceedings of the 8th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL ’81, page 187–199, New York, NY, USA. ACM.
Typeshed (2025). [link]. GitHub repository.
Wang, K., Li, T., Zhang, X., Wang, C., Sun, W., Liu, Y., and Shi, B. (2025). Software development life cycle perspective: A survey of benchmarks for code large language models and agents.
Publicado
11/05/2026
Como Citar
SAFINA, Larisa.
Towards Hybrid and Reusable Type Inference for Dynamically-Typed Languages. In: CONGRESSO IBERO-AMERICANO EM ENGENHARIA DE SOFTWARE (CIBSE), 29. , 2026, Recife/PE.
Anais [...].
Porto Alegre: Sociedade Brasileira de Computação,
2026
.
p. 196-203.
