Introduction

Type inference is the detection of the return type of expressions or the data types of variables in a program. Dynamic programming languages such as Python and JavaScript lack static types. The of data types causes a number of issues such as run-time errors, weaker IDE support, and lower code quality. To alleviate these issues, optional type annotations have been introduced. For instance, the Python community proposed the PEP 484 proposal in 2014, which enables Python developers to add type annotations to an existing codebase or newly written code. Manually adding type annotations to existing codebases is an error-prone and cumbersome process. Motivated by this, researchers have recently applied Machine Learning (ML) techniques to predict type annotations for dynamic programming languages.

Papers

In this session, we will be discussing state-of-the-art ML-based type inference approaches, namely Typilus [1] and TypeWriter [2].

Bibliography

[1]
M. Allamanis, E. T. Barr, S. Ducousso, and Z. Gao, “Typilus: Neural type hints,” in Proceedings of the 41st ACM SIGPLAN conference on programming language design and implementation, 2020, pp. 91–105.
[2]
M. Pradel, G. Gousios, J. Liu, and S. Chandra, “TypeWriter: Neural type prediction with search-based validation,” arXiv preprint arXiv:1912.03768, 2019.
[3]
J. Wei, M. Goyal, G. Durrett, and I. Dillig, “LambdaNet: Probabilistic type inference using graph neural networks,” arXiv preprint arXiv:2005.02161, 2020.
[4]
V. J. Hellendoorn, C. Bird, E. T. Barr, and M. Allamanis, “Deep learning type inference,” in Proceedings of the 2018 26th ACM joint meeting on european software engineering conference and symposium on the foundations of software engineering, 2018, pp. 152–162.
[5]
R. S. Malik, J. Patra, and M. Pradel, “NL2Type: Inferring JavaScript function types from natural language information,” in 2019 IEEE/ACM 41st international conference on software engineering (ICSE), 2019, pp. 304–315.