arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2312.16973cs.PL
收藏

贯穿到底的活对象:消除应用程序与虚拟机之间的壁垒

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

Javier E. Pimás, Stefan Marr, Diego Garbervetsky

AI总结:

提出活元循环运行时(LMRs),消除应用与虚拟机分离,使双方开发者都能用活编程工具调试和修改虚拟机,并在Bee/LMR中验证其可行性。

摘要:

面向对象的语言通常使用虚拟机(VM),这些虚拟机提供诸如即时(JIT)编译和垃圾回收(GC)等机制。这些虚拟机组件通常实现在一个独立的层中,与应用程序隔离。虽然这种方法带来了清晰分离和解耦的软件工程优势,但它也为理解虚拟机行为和演进虚拟机实现设置了障碍。例如,GC和JIT编译器通常在虚拟机构建时固定,限制了运行时的任意自适应。此外,由于这种分离,虚拟机实现通常无法像应用程序代码那样被检查和调试,这固化了易于处理的应用程序代码与难以处理的虚拟机代码之间的区别。这些特性对应用程序开发者理解其自身代码所运行于其上的引擎构成了障碍,并促成了知识鸿沟,阻止应用程序开发者修改虚拟机。\n我们提出活元循环运行时(LMRs)来解决这一问题。LMRs是语言运行时系统,在活编程环境中将虚拟机无缝集成到应用程序中。与经典元循环方法不同,我们提出完全消除应用程序与虚拟机之间的分离。通过系统地将面向对象设计应用于虚拟机组件,我们可以构建足够小而灵活的活运行时系统,使虚拟机工程师能够受益于活编程特性(如短反馈循环),而虚拟机专业知识较少的应用程序开发者也能受益于其程序与虚拟机实现之间更强的因果联系。\n为评估我们的提议,我们实现了Bee/LMR,一个用于Smalltalk衍生环境的活虚拟机,代码量为22057行。我们分析了调整垃圾回收器、避免即时编译器重新编译以及添加对向量指令优化代码的支持等案例研究,以展示在用于生产的工业应用背景下,将探索性编程扩展到虚拟机开发的权衡。基于这些案例研究,我们说明了我们的方法如何促进一小队应用程序开发者的日常开发工作。\n我们的方法使虚拟机开发者能够获得传统上为应用程序开发者保留的活编程工具,而应用程序开发者则可以使用他们日常使用的高级工具与虚拟机交互并修改它。应用程序和虚拟机开发者都可以无缝地检查、调试、理解和修改虚拟机的不同部分,并享有更短的反馈循环和更高级的工具。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑