Abstract
Dynamic object-oriented languages, such as Python, Ruby, and Javascript are widely used nowadays. A distinguishing feature of dynamic object-oriented languages is that objects, the fundamental runtime data representation, are highly dynamic, meaning that a single constructor may create objects with different types and objects can evolve freely after their construction. While such dynamism facilitates fast prototyping, it brings many challenges to program understanding. Many type systems have been developed to aid programming understanding, and they adopt various types and techniques to represent and track dynamic objects. However, although many types and techniques have been proposed, it is unclear which one suits real dynamic object usages best. Motivated by this situation, we perform an empirical study on 50 mature Python programs with a focus on object dynamism and object type models. We found that (1) object dynamism is highly prevalent in Python programs, (2) class-based types are not precise to handle dynamic behaviors, as they introduce type errors for 52% of the evaluated polymorphic attributes, (3) typestate-based types, although mostly used in static languages, matches the behaviors of dynamic objects faithfully, and (4) some well-designed but still lightweight techniques for object-based types, such as argument type separation and recency abstraction can precisely characterize dynamic object behaviors. Those techniques are suitable for building precise but still concise object-based types.
| Original language | English |
|---|---|
| Title of host publication | Programming Languages and Systems |
| Subtitle of host publication | 21st Asian Symposium, APLAS 2023 |
| Publisher | Springer |
| Pages | 24-45 |
| DOIs | |
| Publication status | Published - 21 Nov 2023 |
| Event | APLAS 2023: 21st Asian Symposium - Taipei, Taiwan Duration: 26 Nov 2023 → 29 Nov 2023 https://conf.researchr.org/home/aplas-2023/ |
Publication series
| Name | Lecture Notes in Computer Science (LNCS) |
|---|---|
| Publisher | Springer |
| ISSN (Print) | 0302-9743 |
| ISSN (Electronic) | 1611-3349 |
Conference
| Conference | APLAS 2023 |
|---|---|
| Country/Territory | Taiwan |
| Period | 26/11/23 → 29/11/23 |
| Internet address |
Research Groups and Themes
- Programming Languages
Fingerprint
Dive into the research topics of 'What Types Are Needed for Typing Dynamic Objects? A Python-Based Empirical Study'. Together they form a unique fingerprint.Cite this
- APA
- Author
- BIBTEX
- Harvard
- Standard
- RIS
- Vancouver