Exploring Cheap Type Inference Heuristics in Dynamically Typed Languages

Milojković, Nevena; Nierstrasz, Oscar Marius (2016). Exploring Cheap Type Inference Heuristics in Dynamically Typed Languages. In: 2016 ACM International Symposium on New Ideas, New Paradigms, and Reflections on Programming and Software, Onward! 2016 (pp. 43-56). New York, NY, USA: ACM 10.1145/2986012.2986017

[img] Text
Milo16b.pdf - Accepted Version
Restricted to registered users only
Available under License Publisher holds Copyright.

Download (301kB)

Although dynamically typed languages allow developers to be more productive in writing source code, their lack of information about types of variables is one of the main obstacles during program comprehension. Static type information helps developers to decrease software maintenance time. Inferring the types of variables requires complex algorithms in order to avoid false positives or negatives. Their main aim is to shorten the list of possible types for a variable. We have developed a couple of cheap heuristics that use easily accessible information about the presence of each class in the available source code 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 both for domain- specific types and standard libraries these heuristics tend to work well. The evaluated heuristics prove to be reasonably precise, promoting the correct types of a variable towards the top of the list in 50.67 up to 89.09 of cases on average, depending on the applied heuristic. The heuristic that has proven to be the best was compared with one existing type inference algorithm and the best heuristic yields significantly better results with less effort.

Item Type:

Conference or Workshop Item (Paper)

Division/Institute:

08 Faculty of Science > Institute of Computer Science (INF)
08 Faculty of Science > Institute of Computer Science (INF) > Software Composition Group (SCG) [discontinued]

UniBE Contributor:

Nierstrasz, Oscar

Subjects:

000 Computer science, knowledge & systems
500 Science > 510 Mathematics

ISBN:

978-1-4503-4076-2

Publisher:

ACM

Language:

English

Submitter:

Oscar Nierstrasz

Date Deposited:

08 May 2017 14:21

Last Modified:

02 Mar 2023 23:29

Publisher DOI:

10.1145/2986012.2986017

Uncontrolled Keywords:

scg-pub snf-asa2 scg16 jb17 Milojkovic

BORIS DOI:

10.7892/boris.99619

URI:

https://boris.unibe.ch/id/eprint/99619

Actions (login required)

Edit item Edit item
Provide Feedback