Skip to main content
Cornell University
We gratefully acknowledge support from the Simons Foundation, member institutions, and all contributors. Donate
arxiv logo > cs > arXiv:2306.12410

Help | Advanced Search

arXiv logo
Cornell University Logo

quick links

  • Login
  • Help Pages
  • About

Computer Science > Programming Languages

arXiv:2306.12410 (cs)
[Submitted on 21 Jun 2023]

Title:A VM-Agnostic and Backwards Compatible Protected Modifier for Dynamically-Typed Languages

Authors:Iona Thomas (1), Vincent Aranega (1), Stéphane Ducasse (1), Guillermo Polito (1), Pablo Tesone (1) ((1) University of Lille, France / Inria, France / CNRS, France / Centrale Lille, France / CRIStAL, France)
View a PDF of the paper titled A VM-Agnostic and Backwards Compatible Protected Modifier for Dynamically-Typed Languages, by Iona Thomas (1) and 9 other authors
View PDF
Abstract:In object-oriented languages, method visibility modifiers hold a key role in separating internal methods from the public API. Protected visibility modifiers offer a way to hide methods from external objects while authorizing internal use and overriding in subclasses. While present in main statically-typed languages, visibility modifiers are not as common or mature in dynamically-typed languages. In this article, we present ProtDyn, a self-send-based visibility model calculated at compile time for dynamically-typed languages relying on name-mangling and syntactic differentiation of self vs non self sends. We present #Pharo, a ProtDyn implementation of this model that is backwards compatible with existing programs, and its port to Python. Using these implementations we study the performance impact of ProtDyn on the method lookup, in the presence of global lookup caches and polymorphic inline caches. We show that our name mangling and double method registration technique has a very low impact on performance and keeps the benefits from the global lookup cache and polymorphic inline cache. We also show that the memory overhead on a real use case is between 2% and 13% in the worst-case scenario. Protected modifier semantics enforces encapsulation such as private but allow developers to still extend the class in subclasses. ProtDyn offers a VM-agnostic and backwards-compatible design to introduce protected semantics in dynamically-typed languages.
Subjects: Programming Languages (cs.PL)
Cite as: arXiv:2306.12410 [cs.PL]
  (or arXiv:2306.12410v1 [cs.PL] for this version)
  https://doi.org/10.48550/arXiv.2306.12410
arXiv-issued DOI via DataCite
Journal reference: The Art, Science, and Engineering of Programming, 2024, Vol. 8, Issue 1, Article 2
Related DOI: https://doi.org/10.22152/programming-journal.org/2024/8/2
DOI(s) linking to related resources

Submission history

From: Iona Thomas [view email] [via PROGRAMMINGJOURNAL proxy]
[v1] Wed, 21 Jun 2023 17:48:17 UTC (899 KB)
Full-text links:

Access Paper:

    View a PDF of the paper titled A VM-Agnostic and Backwards Compatible Protected Modifier for Dynamically-Typed Languages, by Iona Thomas (1) and 9 other authors
  • View PDF
  • Other Formats
view license
Current browse context:
cs.PL
< prev   |   next >
new | recent | 2023-06
Change to browse by:
cs

References & Citations

  • NASA ADS
  • Google Scholar
  • Semantic Scholar
a export BibTeX citation Loading...

BibTeX formatted citation

×
Data provided by:

Bookmark

BibSonomy logo Reddit logo

Bibliographic and Citation Tools

Bibliographic Explorer (What is the Explorer?)
Connected Papers (What is Connected Papers?)
Litmaps (What is Litmaps?)
scite Smart Citations (What are Smart Citations?)

Code, Data and Media Associated with this Article

alphaXiv (What is alphaXiv?)
CatalyzeX Code Finder for Papers (What is CatalyzeX?)
DagsHub (What is DagsHub?)
Gotit.pub (What is GotitPub?)
Hugging Face (What is Huggingface?)
Papers with Code (What is Papers with Code?)
ScienceCast (What is ScienceCast?)

Demos

Replicate (What is Replicate?)
Hugging Face Spaces (What is Spaces?)
TXYZ.AI (What is TXYZ.AI?)

Recommenders and Search Tools

Influence Flower (What are Influence Flowers?)
CORE Recommender (What is CORE?)
  • Author
  • Venue
  • Institution
  • Topic

arXivLabs: experimental projects with community collaborators

arXivLabs is a framework that allows collaborators to develop and share new arXiv features directly on our website.

Both individuals and organizations that work with arXivLabs have embraced and accepted our values of openness, community, excellence, and user data privacy. arXiv is committed to these values and only works with partners that adhere to them.

Have an idea for a project that will add value for arXiv's community? Learn more about arXivLabs.

Which authors of this paper are endorsers? | Disable MathJax (What is MathJax?)
  • About
  • Help
  • contact arXivClick here to contact arXiv Contact
  • subscribe to arXiv mailingsClick here to subscribe Subscribe
  • Copyright
  • Privacy Policy
  • Web Accessibility Assistance
  • arXiv Operational Status
    Get status notifications via email or slack