4 research outputs found
Inferring useful static types for duck typed languages
Complete and precise identification of types is essential to the effectiveness
of programming aids such as refactoring or code completion. Existing approaches
that target dynamically typed languages infer types using flow
analysis, but flow analysis does not cope well with heavily used features
such as heterogeneous containers and implicit interfaces.
Our solution makes the assumption that programs that are known to work
do not encounter run-time type errors which allows us to derive extra type
information from the way values are used, rather than simply where those
values originate. This is in keeping with the “duck typing” philosophy of
many dynamically typed languages.
The information we derive must be conservative, so we describe and formalise
a technique to ‘freeze’ the duck type of a variable using the features,
such as named methods, that are provably present on any run of the program.
Development environments can use these sets of features to provide
code-completion suggestions and API documentation, amongst other things.
We show that these sets of features can be used to refine imprecise flow analysis
results by using the frozen duck type to perform a structural type-cast.
We first formalise this for an idealised duck-typed language semantics and
then show to what extent the technique would work for a real-world language,
Python. We demonstrate its effectiveness by performing an analysis
of several real-world Python programs which shows that we can infer the
types of method-call receivers more precisely than can flow analysis alone
Programming Languages and Systems
This open access book constitutes the proceedings of the 29th European Symposium on Programming, ESOP 2020, which was planned to take place in Dublin, Ireland, in April 2020, as Part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2020. The actual ETAPS 2020 meeting was postponed due to the Corona pandemic. The papers deal with fundamental issues in the specification, design, analysis, and implementation of programming languages and systems
Proceedings of Monterey Workshop 2001 Engineering Automation for Sofware Intensive System Integration
The 2001 Monterey Workshop on Engineering Automation for Software Intensive System Integration was sponsored by the Office of Naval Research, Air Force Office of Scientific Research, Army Research Office and the Defense Advance Research Projects Agency. It is our pleasure to thank the workshop advisory and sponsors for their vision of a principled engineering solution for software and for their many-year tireless effort in supporting a series of workshops to bring everyone together.This workshop is the 8 in a series of International workshops. The workshop was held in Monterey Beach Hotel, Monterey, California during June 18-22, 2001. The general theme of the workshop has been to present and discuss research works that aims at increasing the practical impact of formal methods for software and systems engineering. The particular focus of this workshop was "Engineering Automation for Software Intensive System Integration". Previous workshops have been focused on issues including, "Real-time & Concurrent Systems", "Software Merging and Slicing", "Software Evolution", "Software Architecture", "Requirements Targeting Software" and "Modeling Software System Structures in a fastly moving scenario".Office of Naval ResearchAir Force Office of Scientific Research Army Research OfficeDefense Advanced Research Projects AgencyApproved for public release, distribution unlimite