Live Objects All The Way Down: Removing the Barriers between Applications and Virtual Machines

Javier Pimás, Stefan Marr, D. Garbervetsky
{"title":"Live Objects All The Way Down: Removing the Barriers between Applications and Virtual Machines","authors":"Javier Pimás, Stefan Marr, D. Garbervetsky","doi":"10.22152/programming-journal.org/2024/8/5","DOIUrl":null,"url":null,"abstract":"Object-oriented languages often use virtual machines (VMs) that provide mechanisms such as just-in-time (JIT) compilation and garbage collection (GC). These VM components are typically implemented in a separate layer, isolating them from the application. While this approach brings the software engineering benefits of clear separation and decoupling, it introduces barriers for both understanding VM behavior and evolving the VM implementation. For example, the GC and JIT compiler are typically fixed at VM build time, limiting arbitrary adaptation at run time. Furthermore, because of this separation, the implementation of the VM cannot typically be inspected and debugged in the same way as application code, enshrining a distinction in easy-to-work-with application and hard-to-work-with VM code. These characteristics pose a barrier for application developers to understand the engine on top of which their own code runs, and fosters a knowledge gap that prevents application developers to change the VM. We propose Live Metacircular Runtimes (LMRs) to overcome this problem. LMRs are language runtime systems that seamlessly integrate the VM into the application in live programming environments. Unlike classic metacircular approaches, we propose to completely remove the separation between application and VM. By systematically applying object-oriented design to VM components, we can build live runtime systems that are small and flexible enough, where VM engineers can benefit of live programming features such as short feedback loops, and application developers with fewer VM expertise can benefit of the stronger causal connections between their programs and the VM implementation. To evaluate our proposal, we implemented Bee/LMR, a live VM for a Smalltalk-derivative environment in 22057 lines of code. We analyze case studies on tuning the garbage collector, avoiding recompilations by the just-in-time compiler, and adding support to optimize code with vector instructions to demonstrate the trade-offs of extending exploratory programming to VM development in the context of an industrial application used in production. Based on the case studies, we illustrate how our approach facilitates the daily development work of a small team of application developers. Our approach enables VM developers to gain access to live programming tools traditionally reserved for application developers, while application developers can interact with the VM and modify it using the high-level tools they use every day. Both application and VM developers can seamlessly inspect, debug, understand, and modify the different parts of the VM with shorter feedback loops and higher-level tools.","PeriodicalId":142220,"journal":{"name":"The Art, Science, and Engineering of Programming","volume":"21 1","pages":""},"PeriodicalIF":0.0000,"publicationDate":"2023-10-15","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"The Art, Science, and Engineering of Programming","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.22152/programming-journal.org/2024/8/5","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0

Abstract

Object-oriented languages often use virtual machines (VMs) that provide mechanisms such as just-in-time (JIT) compilation and garbage collection (GC). These VM components are typically implemented in a separate layer, isolating them from the application. While this approach brings the software engineering benefits of clear separation and decoupling, it introduces barriers for both understanding VM behavior and evolving the VM implementation. For example, the GC and JIT compiler are typically fixed at VM build time, limiting arbitrary adaptation at run time. Furthermore, because of this separation, the implementation of the VM cannot typically be inspected and debugged in the same way as application code, enshrining a distinction in easy-to-work-with application and hard-to-work-with VM code. These characteristics pose a barrier for application developers to understand the engine on top of which their own code runs, and fosters a knowledge gap that prevents application developers to change the VM. We propose Live Metacircular Runtimes (LMRs) to overcome this problem. LMRs are language runtime systems that seamlessly integrate the VM into the application in live programming environments. Unlike classic metacircular approaches, we propose to completely remove the separation between application and VM. By systematically applying object-oriented design to VM components, we can build live runtime systems that are small and flexible enough, where VM engineers can benefit of live programming features such as short feedback loops, and application developers with fewer VM expertise can benefit of the stronger causal connections between their programs and the VM implementation. To evaluate our proposal, we implemented Bee/LMR, a live VM for a Smalltalk-derivative environment in 22057 lines of code. We analyze case studies on tuning the garbage collector, avoiding recompilations by the just-in-time compiler, and adding support to optimize code with vector instructions to demonstrate the trade-offs of extending exploratory programming to VM development in the context of an industrial application used in production. Based on the case studies, we illustrate how our approach facilitates the daily development work of a small team of application developers. Our approach enables VM developers to gain access to live programming tools traditionally reserved for application developers, while application developers can interact with the VM and modify it using the high-level tools they use every day. Both application and VM developers can seamlessly inspect, debug, understand, and modify the different parts of the VM with shorter feedback loops and higher-level tools.
Live Objects All The Way Down:消除应用程序与虚拟机之间的障碍
面向对象语言通常使用虚拟机(VM),虚拟机提供及时编译(JIT)和垃圾回收(GC)等机制。这些虚拟机组件通常在单独的层中实现,与应用程序隔离开来。虽然这种方法带来了明确分离和解耦的软件工程优势,但也为理解虚拟机行为和改进虚拟机实现带来了障碍。例如,GC 和 JIT 编译器在虚拟机构建时通常是固定的,从而限制了运行时的任意调整。此外,由于这种分离,虚拟机的实现通常不能像应用程序代码那样进行检查和调试,从而使易于操作的应用程序代码和难以操作的虚拟机代码之间存在差异。这些特点阻碍了应用程序开发人员了解自己的代码在其上运行的引擎,并造成了知识鸿沟,阻碍了应用程序开发人员改变虚拟机。我们提出了实时元循环运行时(LMR)来克服这一问题。LMR 是一种语言运行时系统,可在实时编程环境中将虚拟机无缝集成到应用程序中。与经典的元循环方法不同,我们建议完全消除应用程序与虚拟机之间的分离。通过系统地将面向对象设计应用于虚拟机组件,我们可以构建足够小巧灵活的实时运行时系统,虚拟机工程师可以从实时编程功能(如短反馈回路)中获益,而缺乏虚拟机专业知识的应用程序开发人员则可以从他们的程序与虚拟机实现之间更强的因果联系中获益。为了评估我们的建议,我们用 22057 行代码为 Smalltalk 衍生环境实现了实时虚拟机 Bee/LMR。我们分析了有关调整垃圾收集器、避免及时编译器的重新编译以及添加支持优化矢量指令代码的案例研究,以展示在生产中使用的工业应用背景下将探索式编程扩展到虚拟机开发的利弊权衡。在案例研究的基础上,我们说明了我们的方法是如何促进小型应用程序开发团队的日常开发工作的。我们的方法使虚拟机开发人员能够使用传统上专供应用程序开发人员使用的实时编程工具,而应用程序开发人员则可以使用他们日常使用的高级工具与虚拟机进行交互和修改。应用程序和虚拟机开发人员都可以利用更短的反馈回路和更高级的工具,无缝地检查、调试、理解和修改虚拟机的不同部分。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
CiteScore
1.70
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信