Evolving a reflective language: lessons learned from implementing traits

Stéphane Ducasse, M. Denker, Adrian Lienhard
{"title":"Evolving a reflective language: lessons learned from implementing traits","authors":"Stéphane Ducasse, M. Denker, Adrian Lienhard","doi":"10.1145/1735935.1735949","DOIUrl":null,"url":null,"abstract":"Traits are method groups that can be used to compose classes. They do not have a runtime existence and are conceptually folded into the classes that use them. Traits have been implemented in different languages. While implementing them in Smalltalk, our first reflex was to take advantage of the fact that traits are not run-time entities: we optimized the implementation for space and hence shared methods between traits and classes. However, by doing so we broke the introspective API of Smalltalk.\n This paper illustrates a more general problem seen in all reflective systems: the implementation serves both as a model for execution and as the model that is exposed to the programmer. There is a conflict of interests between the information necessary for execution and the information the programmer is interested in. In addition, as soon as the implementation is exposed via reflection, we are not free to optimize. As the complete implementation is visible reflectively, there is no way to hide the optimizations.\n Few papers report errors and this is one of them. We report our experience facing the initial API mismatch, which has a significant impact on the system because the language is reflective (i.e., written in itself and causally connected). We present the new introspective API we put in place.","PeriodicalId":393791,"journal":{"name":"International Workshop on Smalltalk Technologies","volume":"5 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2009-08-31","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"5","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"International Workshop on Smalltalk Technologies","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/1735935.1735949","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 5

Abstract

Traits are method groups that can be used to compose classes. They do not have a runtime existence and are conceptually folded into the classes that use them. Traits have been implemented in different languages. While implementing them in Smalltalk, our first reflex was to take advantage of the fact that traits are not run-time entities: we optimized the implementation for space and hence shared methods between traits and classes. However, by doing so we broke the introspective API of Smalltalk. This paper illustrates a more general problem seen in all reflective systems: the implementation serves both as a model for execution and as the model that is exposed to the programmer. There is a conflict of interests between the information necessary for execution and the information the programmer is interested in. In addition, as soon as the implementation is exposed via reflection, we are not free to optimize. As the complete implementation is visible reflectively, there is no way to hide the optimizations. Few papers report errors and this is one of them. We report our experience facing the initial API mismatch, which has a significant impact on the system because the language is reflective (i.e., written in itself and causally connected). We present the new introspective API we put in place.
查看原文
分享 分享
微信好友 朋友圈 QQ好友 复制链接
本刊更多论文
发展反思性语言:从实现特征中学到的经验教训
trait是可以用来组成类的方法组。它们在运行时不存在,并且在概念上被折叠到使用它们的类中。特性是用不同的语言实现的。在Smalltalk中实现它们时,我们的第一反应是利用trait不是运行时实体的事实:我们针对空间优化了实现,因此在trait和类之间共享方法。然而,这样做我们破坏了Smalltalk的内省API。本文阐述了在所有反射系统中常见的一个更普遍的问题:实现既充当执行的模型,又充当向程序员公开的模型。执行所必需的信息和程序员感兴趣的信息之间存在利益冲突。此外,一旦通过反射暴露了实现,我们就不能自由地进行优化。由于可以反射地看到完整的实现,因此无法隐藏优化。很少有论文报告错误,这是其中之一。我们报告我们面对初始API不匹配的经验,这对系统有重大影响,因为语言是反射的(即,自己编写并因果连接)。我们展示了新的内省API。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 去求助
来源期刊
自引率
0.00%
发文量
0
期刊最新文献
Spec: a framework for the specification and reuse of UIs and their models On the integration of Smalltalk and Java: practical experience with STX:LIBJAVA Tracking down software changes responsible for performance loss Refactoring support for Smalltalk using static type inference Challenges to support automated random testing for dynamically typed languages
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
现在去查看 取消
×
提示
确定
0
微信
客服QQ
Book学术公众号 扫码关注我们
反馈
×
意见反馈
请填写您的意见或建议
请填写您的手机或邮箱
已复制链接
已复制链接
快去分享给好友吧!
我知道了
×
扫码分享
扫码分享
Book学术官方微信
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术
文献互助 智能选刊 最新文献 互助须知 联系我们:info@booksci.cn
Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。
Copyright © 2023 Book学术 All rights reserved.
ghs 京公网安备 11010802042870号 京ICP备2023020795号-1