Inferring Types by Mining Class Usage Frequency from Inline Caches - Archive ouverte HAL Accéder directement au contenu
Communication Dans Un Congrès Année : 2016

Inferring Types by Mining Class Usage Frequency from Inline Caches

Résumé

Dynamically typed languages allow developers to write more expressive source code, but their lack of static information about types of variables increases the complexity of a program. Static type information about types of variables facilitates program comprehension and maintenance. Simple type inference algorithms suffer from the problem of false positives or negatives, thus complex approaches are required to avoid this problem. We propose a simple heuristic that uses easily accessible run-time information about the usage of each class as a receiver type for a message send. This frequency serves as a proxy for the likelihood that a run-time type of the variable is that class and it is used to promote the correct type towards the top of the list of possible types for a variable. Our evaluation of a proof-of-concept prototype implemented in Pharo Smalltalk shows that our heuristic is reasonably precise to detect correct types on average in 65.92% to 82.83% of cases.
Fichier principal
Vignette du fichier
TypeInferenceDynamicDataPreprint.pdf (355.62 Ko) Télécharger le fichier
Origine : Fichiers produits par l'(les) auteur(s)
Loading...

Dates et versions

hal-01357071 , version 1 (29-08-2016)

Identifiants

Citer

Nevena Milojković, Clément Bera, Mohammad Ghafari, Oscar Nierstrasz. Inferring Types by Mining Class Usage Frequency from Inline Caches. Proceedings of the 11th edition of the International Workshop on Smalltalk Technologies, 2016, Pragues, Czech Republic. ⟨10.1145/2991041.2991047⟩. ⟨hal-01357071⟩
128 Consultations
217 Téléchargements

Altmetric

Partager

Gmail Facebook X LinkedIn More