File Download
  Links for fulltext
     (May Require Subscription)
Supplementary

Article: Separating Use and Reuse to Improve Both

TitleSeparating Use and Reuse to Improve Both
Authors
Keywordstrait composition
subtyping
code reuse
Issue Date2019
PublisherAOSA, Inc. The Journal's web site is located at https://programming-journal.org/
Citation
The Art, Science, and Engineering of Programming, 2019, v. 3 n. 3, p. article no. 12 How to Cite?
AbstractContext: Trait composition has inspired new research in the area of code reuse for object oriented (OO) languages. One of the main advantages of this kind of composition is that it makes possible to separate subtyping from subclassing; which is good for code-reuse, design and reasoning. However, handling of state within traits is difficult, verbose or inelegant. Inquiry: We identify the this-leaking problem as the fundamental limitation that prevents the separation of subtyping from subclassing in conventional OO languages. We explain that the concept of trait composition addresses this problem, by distinguishing code designed for use (as a type) from code designed for reuse (i.e. inherited). We are aware of at least 3 concrete independently designed research languages following this methodology: TraitRecordJ, Package Templates and DeepFJig. Approach: In this paper, we design 42µ, a new language, where we improve use and reuse and support the This type and family polymorphism by distinguishing code designed for use from code designed for reuse. In this way 42µ synthesise the 3 approaches above, and improves them with abstract state operations: a new elegant way to handle state composition in trait based languages. Knowledge and Grounding: Using case studies, we show that 42µ’s model of traits with abstract state operations is more usable and compact than prior work. We formalise our work and prove that type errors cannot arise from composing well typed code. Importance: This work is the logical core of the programming language 42. This shows that the ideas presented in this paper can be applicable to a full general purpose language. This form of composition is very flexible and could be used in many new languages.
Persistent Identifierhttp://hdl.handle.net/10722/301193
ISSN
2023 SCImago Journal Rankings: 0.212

 

DC FieldValueLanguage
dc.contributor.authorArora, H-
dc.contributor.authorServetto, M-
dc.contributor.authorDos Santos Oliveira, BCDS-
dc.date.accessioned2021-07-27T08:07:30Z-
dc.date.available2021-07-27T08:07:30Z-
dc.date.issued2019-
dc.identifier.citationThe Art, Science, and Engineering of Programming, 2019, v. 3 n. 3, p. article no. 12-
dc.identifier.issn2473-7321-
dc.identifier.urihttp://hdl.handle.net/10722/301193-
dc.description.abstractContext: Trait composition has inspired new research in the area of code reuse for object oriented (OO) languages. One of the main advantages of this kind of composition is that it makes possible to separate subtyping from subclassing; which is good for code-reuse, design and reasoning. However, handling of state within traits is difficult, verbose or inelegant. Inquiry: We identify the this-leaking problem as the fundamental limitation that prevents the separation of subtyping from subclassing in conventional OO languages. We explain that the concept of trait composition addresses this problem, by distinguishing code designed for use (as a type) from code designed for reuse (i.e. inherited). We are aware of at least 3 concrete independently designed research languages following this methodology: TraitRecordJ, Package Templates and DeepFJig. Approach: In this paper, we design 42µ, a new language, where we improve use and reuse and support the This type and family polymorphism by distinguishing code designed for use from code designed for reuse. In this way 42µ synthesise the 3 approaches above, and improves them with abstract state operations: a new elegant way to handle state composition in trait based languages. Knowledge and Grounding: Using case studies, we show that 42µ’s model of traits with abstract state operations is more usable and compact than prior work. We formalise our work and prove that type errors cannot arise from composing well typed code. Importance: This work is the logical core of the programming language 42. This shows that the ideas presented in this paper can be applicable to a full general purpose language. This form of composition is very flexible and could be used in many new languages.-
dc.languageeng-
dc.publisherAOSA, Inc. The Journal's web site is located at https://programming-journal.org/-
dc.relation.ispartofThe Art, Science, and Engineering of Programming-
dc.rightsThis work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.-
dc.subjecttrait composition-
dc.subjectsubtyping-
dc.subjectcode reuse-
dc.titleSeparating Use and Reuse to Improve Both-
dc.typeArticle-
dc.identifier.emailDos Santos Oliveira, BCDS: bruno@cs.hku.hk-
dc.identifier.authorityDos Santos Oliveira, BCDS=rp01786-
dc.description.naturepublished_or_final_version-
dc.identifier.doi10.22152/programming-journal.org/2019/3/12-
dc.identifier.hkuros323729-
dc.identifier.volume3-
dc.identifier.issue3-
dc.identifier.spagearticle no. 12-
dc.identifier.epagearticle no. 12-
dc.publisher.placeUnited States-

Export via OAI-PMH Interface in XML Formats


OR


Export to Other Non-XML Formats