首页 > 最新文献

The Art, Science, and Engineering of Programming最新文献

英文 中文
Live Objects All The Way Down: Removing the Barriers between Applications and Virtual Machines Live Objects All The Way Down:消除应用程序与虚拟机之间的障碍
Pub Date : 2023-10-15 DOI: 10.22152/programming-journal.org/2024/8/5
Javier Pimás, Stefan Marr, D. Garbervetsky
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.
面向对象语言通常使用虚拟机(VM),虚拟机提供及时编译(JIT)和垃圾回收(GC)等机制。这些虚拟机组件通常在单独的层中实现,与应用程序隔离开来。虽然这种方法带来了明确分离和解耦的软件工程优势,但也为理解虚拟机行为和改进虚拟机实现带来了障碍。例如,GC 和 JIT 编译器在虚拟机构建时通常是固定的,从而限制了运行时的任意调整。此外,由于这种分离,虚拟机的实现通常不能像应用程序代码那样进行检查和调试,从而使易于操作的应用程序代码和难以操作的虚拟机代码之间存在差异。这些特点阻碍了应用程序开发人员了解自己的代码在其上运行的引擎,并造成了知识鸿沟,阻碍了应用程序开发人员改变虚拟机。我们提出了实时元循环运行时(LMR)来克服这一问题。LMR 是一种语言运行时系统,可在实时编程环境中将虚拟机无缝集成到应用程序中。与经典的元循环方法不同,我们建议完全消除应用程序与虚拟机之间的分离。通过系统地将面向对象设计应用于虚拟机组件,我们可以构建足够小巧灵活的实时运行时系统,虚拟机工程师可以从实时编程功能(如短反馈回路)中获益,而缺乏虚拟机专业知识的应用程序开发人员则可以从他们的程序与虚拟机实现之间更强的因果联系中获益。为了评估我们的建议,我们用 22057 行代码为 Smalltalk 衍生环境实现了实时虚拟机 Bee/LMR。我们分析了有关调整垃圾收集器、避免及时编译器的重新编译以及添加支持优化矢量指令代码的案例研究,以展示在生产中使用的工业应用背景下将探索式编程扩展到虚拟机开发的利弊权衡。在案例研究的基础上,我们说明了我们的方法是如何促进小型应用程序开发团队的日常开发工作的。我们的方法使虚拟机开发人员能够使用传统上专供应用程序开发人员使用的实时编程工具,而应用程序开发人员则可以使用他们日常使用的高级工具与虚拟机进行交互和修改。应用程序和虚拟机开发人员都可以利用更短的反馈回路和更高级的工具,无缝地检查、调试、理解和修改虚拟机的不同部分。
{"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":"https://doi.org/10.22152/programming-journal.org/2024/8/5","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.0,"publicationDate":"2023-10-15","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"139318894","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 0
Provably Fair Cooperative Scheduling 可证明的公平合作调度
Pub Date : 2023-10-15 DOI: 10.22152/programming-journal.org/2024/8/6
Reiner Hahnle, Ludovic Henrio
The context of this work is cooperative scheduling, a concurrency paradigm, where task execution is not arbitrarily preempted. Instead, language constructs exist that let a task voluntarily yield the right to execute to another task. The inquiry is the design of provably fair schedulers and suitable notions of fairness for cooperative scheduling languages. To the best of our knowledge, this problem has not been addressed so far. Our approach is to study fairness independently from syntactic constructs or environments, purely from the point of view of the semantics of programming languages, i.e., we consider fairness criteria using the formal definition of a program execution. We develop our concepts for classic structural operational semantics (SOS) as well as for the recent locally abstract, globally concrete (LAGC) semantics. The latter is a highly modular approach to semantics ensuring the separation of concerns between local statement evaluation and scheduling decisions. The new knowledge contributed by our work is threefold: first, we show that a new fairness notion, called quiescent fairness, is needed to characterize fairness adequately in the context of cooperative scheduling; second, we define a provably fair scheduler for cooperative scheduling languages; third, a qualitative comparison between the SOS and LAGC versions yields that the latter, while taking higher initial effort, is more amenable to proving fairness and scales better under language extensions than SOS. The grounding of our work is a detailed formal proof of quiescent fairness for the scheduler defined in LAGC semantics. The importance of our work is that it provides a formal foundation for the implementation of fair schedulers for cooperative scheduling languages, an increasingly popular paradigm (for example: akka/Scala, JavaScript, async Rust). Being based solely on semantics, our ideas are widely applicable. Further, our work makes clear that the standard notion of fairness in concurrent languages needs to be adapted for cooperative scheduling and, more generally, for any language that combines atomic execution sequences with some form of preemption.
这项工作的背景是合作调度,这是一种并发范例,在这种范例中,任务的执行不会被任意抢占。相反,有一种语言结构可以让一个任务自愿将执行权让给另一个任务。研究的重点是为合作调度语言设计可证明的公平调度器和合适的公平概念。据我们所知,这个问题至今尚未解决。我们的方法是独立于语法结构或环境,纯粹从编程语言语义的角度来研究公平性,也就是说,我们使用程序执行的形式定义来考虑公平性标准。我们为经典的结构运算语义(SOS)和最新的局部抽象、全局具体(LAGC)语义开发了我们的概念。后者是一种高度模块化的语义方法,可确保本地语句评估与调度决策之间的分离。我们的工作贡献了三方面的新知识:首先,我们证明了需要一种新的公平性概念(称为静态公平性)来充分表征合作调度背景下的公平性;其次,我们为合作调度语言定义了一种可证明的公平调度器;第三,通过对 SOS 和 LAGC 版本进行定性比较,我们发现后者虽然需要更多的初始努力,但比 SOS 更易于证明公平性,并且在语言扩展时扩展性更好。我们工作的基础是对 LAGC 语义中定义的调度器的静态公平性进行详细的形式证明。我们工作的重要性在于,它为合作调度语言公平调度器的实现提供了形式基础,而合作调度语言是一种日益流行的范式(例如:Akka/Scala、JavaScript、async Rust)。由于完全基于语义,我们的想法具有广泛的适用性。此外,我们的工作清楚地表明,并发语言中的标准公平概念需要针对合作调度进行调整,更广泛地说,需要针对任何将原子执行序列与某种形式的抢占相结合的语言进行调整。
{"title":"Provably Fair Cooperative Scheduling","authors":"Reiner Hahnle, Ludovic Henrio","doi":"10.22152/programming-journal.org/2024/8/6","DOIUrl":"https://doi.org/10.22152/programming-journal.org/2024/8/6","url":null,"abstract":"The context of this work is cooperative scheduling, a concurrency paradigm, where task execution is not arbitrarily preempted. Instead, language constructs exist that let a task voluntarily yield the right to execute to another task. The inquiry is the design of provably fair schedulers and suitable notions of fairness for cooperative scheduling languages. To the best of our knowledge, this problem has not been addressed so far. Our approach is to study fairness independently from syntactic constructs or environments, purely from the point of view of the semantics of programming languages, i.e., we consider fairness criteria using the formal definition of a program execution. We develop our concepts for classic structural operational semantics (SOS) as well as for the recent locally abstract, globally concrete (LAGC) semantics. The latter is a highly modular approach to semantics ensuring the separation of concerns between local statement evaluation and scheduling decisions. The new knowledge contributed by our work is threefold: first, we show that a new fairness notion, called quiescent fairness, is needed to characterize fairness adequately in the context of cooperative scheduling; second, we define a provably fair scheduler for cooperative scheduling languages; third, a qualitative comparison between the SOS and LAGC versions yields that the latter, while taking higher initial effort, is more amenable to proving fairness and scales better under language extensions than SOS. The grounding of our work is a detailed formal proof of quiescent fairness for the scheduler defined in LAGC semantics. The importance of our work is that it provides a formal foundation for the implementation of fair schedulers for cooperative scheduling languages, an increasingly popular paradigm (for example: akka/Scala, JavaScript, async Rust). Being based solely on semantics, our ideas are widely applicable. Further, our work makes clear that the standard notion of fairness in concurrent languages needs to be adapted for cooperative scheduling and, more generally, for any language that combines atomic execution sequences with some form of preemption.","PeriodicalId":142220,"journal":{"name":"The Art, Science, and Engineering of Programming","volume":"25 1","pages":""},"PeriodicalIF":0.0,"publicationDate":"2023-10-15","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"139318871","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 0
Conceptual Mutation Testing for Student Programming Misconceptions 针对学生编程误区的概念突变测试
Pub Date : 2023-10-15 DOI: 10.22152/programming-journal.org/2024/8/7
Siddhartha Prasad, Ben Greenman, Tim Nelson, S. Krishnamurthi
Context: Students often misunderstand programming problem descriptions. This can lead them to solve the wrong problem, which creates frustration, obstructs learning, and imperils grades. Researchers have found that students can be made to better understand the problem by writing examples before they start programming. These examples are checked against correct and wrong implementations -- analogous to mutation testing -- provided by course staff. Doing so results in better student understanding of the problem as well as better test suites to accompany the program, both of which are desirable educational outcomes. Inquiry: Producing mutant implementations requires care. If there are too many, or they are too obscure, students will end up spending a lot of time on an unproductive task and also become frustrated. Instead, we want a small number of mutants that each correspond to common problem misconceptions. This paper presents a workflow with partial automation to produce mutants of this form which, notably, are not those produced by mutation-testing tools. Approach: We comb through student tests that fail a correct implementation. The student misconceptions are embedded in these failures. We then use methods to semantically cluster these failures. These clusters are then translated into conceptual mutants. These can then be run against student data to determine whether we they are better than prior methods. Some of these processes also enjoy automation. Knowledge: We find that student misconceptions illustrated by failing tests can be operationalized by the above process. The resulting mutants do much better at identifying student misconceptions. Grounding: Our findings are grounded in a manual analysis of student examples and a quantitative evaluation of both our clustering techniques and our process for making conceptual mutants. The clustering evaluation compares against a ground truth using standard cluster-correspondence measures, while the mutant evaluation examines how conceptual mutants perform against student data. Importance: Our work contributes a workflow, with some automation, to reduce the cost and increase the effectiveness of generating conceptually interesting mutants. Such mutants can both improve learning outcomes and reduce student frustration, leading to better educational outcomes. In the process, we also identify a variation of mutation testing not commonly discussed in the software literature.
背景:学生经常误解编程问题的描述。这会导致他们解决错误的问题,从而产生挫败感,阻碍学习,影响成绩。研究人员发现,在学生开始编程之前,可以通过编写示例让他们更好地理解问题。这些示例将与课程人员提供的正确和错误的实现方法(类似于突变测试)进行核对。这样做的结果是,学生对问题有了更好的理解,程序也有了更好的测试套件,这两者都是理想的教育成果。调查:制作突变实现需要小心谨慎。如果数量过多,或者过于晦涩难懂,学生最终会在无用功上花费大量时间,同时也会产生挫败感。相反,我们需要少量的突变体,每个突变体都与常见的问题误解相对应。本文介绍了一种部分自动化的工作流程,用于生成这种形式的突变体,值得注意的是,这种突变体不是由突变测试工具生成的。方法:我们对未能正确实施的学生测试进行梳理。学生的误解就蕴含在这些失败中。然后,我们使用各种方法对这些失败进行语义聚类。然后将这些聚类转化为概念突变体。然后,我们可以针对学生数据运行这些方法,以确定它们是否优于先前的方法。其中一些过程还可以实现自动化。知识:我们发现,测试失败所说明的学生误解可以通过上述过程加以操作化。由此产生的突变体能更好地识别学生的错误认知。基础:我们的研究结果基于对学生范例的人工分析,以及对我们的聚类技术和概念突变体制作过程的定量评估。聚类评估使用标准聚类对应措施与基本事实进行比较,而突变体评估则考察概念突变体在学生数据中的表现。重要性:我们的工作提供了一个工作流程,并在一定程度上实现了自动化,从而降低了生成概念性突变体的成本,提高了生成概念性突变体的效率。这种突变既能提高学习效果,又能减少学生的挫败感,从而取得更好的教育成果。在这一过程中,我们还发现了软件文献中不常见的突变测试变体。
{"title":"Conceptual Mutation Testing for Student Programming Misconceptions","authors":"Siddhartha Prasad, Ben Greenman, Tim Nelson, S. Krishnamurthi","doi":"10.22152/programming-journal.org/2024/8/7","DOIUrl":"https://doi.org/10.22152/programming-journal.org/2024/8/7","url":null,"abstract":"Context: Students often misunderstand programming problem descriptions. This can lead them to solve the wrong problem, which creates frustration, obstructs learning, and imperils grades. Researchers have found that students can be made to better understand the problem by writing examples before they start programming. These examples are checked against correct and wrong implementations -- analogous to mutation testing -- provided by course staff. Doing so results in better student understanding of the problem as well as better test suites to accompany the program, both of which are desirable educational outcomes. Inquiry: Producing mutant implementations requires care. If there are too many, or they are too obscure, students will end up spending a lot of time on an unproductive task and also become frustrated. Instead, we want a small number of mutants that each correspond to common problem misconceptions. This paper presents a workflow with partial automation to produce mutants of this form which, notably, are not those produced by mutation-testing tools. Approach: We comb through student tests that fail a correct implementation. The student misconceptions are embedded in these failures. We then use methods to semantically cluster these failures. These clusters are then translated into conceptual mutants. These can then be run against student data to determine whether we they are better than prior methods. Some of these processes also enjoy automation. Knowledge: We find that student misconceptions illustrated by failing tests can be operationalized by the above process. The resulting mutants do much better at identifying student misconceptions. Grounding: Our findings are grounded in a manual analysis of student examples and a quantitative evaluation of both our clustering techniques and our process for making conceptual mutants. The clustering evaluation compares against a ground truth using standard cluster-correspondence measures, while the mutant evaluation examines how conceptual mutants perform against student data. Importance: Our work contributes a workflow, with some automation, to reduce the cost and increase the effectiveness of generating conceptually interesting mutants. Such mutants can both improve learning outcomes and reduce student frustration, leading to better educational outcomes. In the process, we also identify a variation of mutation testing not commonly discussed in the software literature.","PeriodicalId":142220,"journal":{"name":"The Art, Science, and Engineering of Programming","volume":"58 1","pages":""},"PeriodicalIF":0.0,"publicationDate":"2023-10-15","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"139319155","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 0
The Art, Science, and Engineering of Programming 编程的艺术、科学和工程
Pub Date : 2019-05-31 DOI: 10.22152/programming-journal.org
Stefan Marr
{"title":"The Art, Science, and Engineering of Programming","authors":"Stefan Marr","doi":"10.22152/programming-journal.org","DOIUrl":"https://doi.org/10.22152/programming-journal.org","url":null,"abstract":"","PeriodicalId":142220,"journal":{"name":"The Art, Science, and Engineering of Programming","volume":"6 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2019-05-31","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"127495248","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 41
期刊
The Art, Science, and Engineering of Programming
全部 Acc. Chem. Res. ACS Applied Bio Materials ACS Appl. Electron. Mater. ACS Appl. Energy Mater. ACS Appl. Mater. Interfaces ACS Appl. Nano Mater. ACS Appl. Polym. Mater. ACS BIOMATER-SCI ENG ACS Catal. ACS Cent. Sci. ACS Chem. Biol. ACS Chemical Health & Safety ACS Chem. Neurosci. ACS Comb. Sci. ACS Earth Space Chem. ACS Energy Lett. ACS Infect. Dis. ACS Macro Lett. ACS Mater. Lett. ACS Med. Chem. Lett. ACS Nano ACS Omega ACS Photonics ACS Sens. ACS Sustainable Chem. Eng. ACS Synth. Biol. Anal. Chem. BIOCHEMISTRY-US Bioconjugate Chem. BIOMACROMOLECULES Chem. Res. Toxicol. Chem. Rev. Chem. Mater. CRYST GROWTH DES ENERG FUEL Environ. Sci. Technol. Environ. Sci. Technol. Lett. Eur. J. Inorg. Chem. IND ENG CHEM RES Inorg. Chem. J. Agric. Food. Chem. J. Chem. Eng. Data J. Chem. Educ. J. Chem. Inf. Model. J. Chem. Theory Comput. J. Med. Chem. J. Nat. Prod. J PROTEOME RES J. Am. Chem. Soc. LANGMUIR MACROMOLECULES Mol. Pharmaceutics Nano Lett. Org. Lett. ORG PROCESS RES DEV ORGANOMETALLICS J. Org. Chem. J. Phys. Chem. J. Phys. Chem. A J. Phys. Chem. B J. Phys. Chem. C J. Phys. Chem. Lett. Analyst Anal. Methods Biomater. Sci. Catal. Sci. Technol. Chem. Commun. Chem. Soc. Rev. CHEM EDUC RES PRACT CRYSTENGCOMM Dalton Trans. Energy Environ. Sci. ENVIRON SCI-NANO ENVIRON SCI-PROC IMP ENVIRON SCI-WAT RES Faraday Discuss. Food Funct. Green Chem. Inorg. Chem. Front. Integr. Biol. J. Anal. At. Spectrom. J. Mater. Chem. A J. Mater. Chem. B J. Mater. Chem. C Lab Chip Mater. Chem. Front. Mater. Horiz. MEDCHEMCOMM Metallomics Mol. Biosyst. Mol. Syst. Des. Eng. Nanoscale Nanoscale Horiz. Nat. Prod. Rep. New J. Chem. Org. Biomol. Chem. Org. Chem. Front. PHOTOCH PHOTOBIO SCI PCCP Polym. Chem.
×
引用
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