当前位置: X-MOL 学术J. Comput. Lang. › 论文详情
Our official English website, www.x-mol.net, welcomes your feedback! (Note: you will need to create a separate account there.)
A lightweight push-pull mechanism for implicitly using signals in imperative programming
Journal of Computer Languages ( IF 2.2 ) Pub Date : 2019-05-25 , DOI: 10.1016/j.cola.2019.100903
YungYu Zhuang

While signals can express time-varying values well, they heavily rely on the semantics of dataflow programming and functional programming. Several research have developed mechanisms for using signals with imperative object-oriented design and shown the benefits of its usage. However, they tend to introduce a class for signals, which thus results in the necessity of lifting up/down between variables and signals. We have already proposed an automation mechanism to expand event systems to support signals without introducing a class, and in this paper, we further extend it to a lightweight push-pull model by considering the direction of trigger. The push-pull automation mechanism allows programmers to choose between push and pull to declaratively express their intention and to reduce the overheads due to unnecessary propagation of value changes. To show the feasibility of our proposal, we implemented PuPPy as an extension to Python for helping programmers in declaring fields as signals. With PuPPy, programmers can use signals in Python without any event system and do not have to worry about the type of events and handlers. We evaluated PuPPy by running preliminary microbenchmarks and comparing with signal class libraries, pure event systems, and the implementation in our previous research.



中文翻译:

一种轻量级的推挽机制,用于在命令式编程中隐式使用信号

尽管信号可以很好地表达随时间变化的值,但它们在很大程度上依赖于数据流编程和功能编程的语义。几项研究已经开发了用于带有命令式面向对象设计的信号的机制,并显示了使用它的好处。但是,它们倾向于引入信号类别,因此导致必须在变量和信号之间提升/降低。我们已经提出了一种自动化机制来扩展事件系统以支持信号,而无需引入类,并且在本文中,我们通过考虑触发器的方向将其进一步扩展为轻量级推挽模型。推挽自动化机制允许程序员之间选择以声明方式表达其意图并减少由于不必要的价值变动传播而产生的间接费用。为了展示我们建议的可行性,我们将PuPPy实施为Python的扩展,以帮助程序员将字段声明为信号。使用PuPPy,程序员可以在Python中使用信号而无需任何事件系统,并且不必担心事件和处理程序的类型。我们通过运行初步的微基准并与信号类库,纯事件系统以及我们先前的研究中的实现进行比较,来评估PuPPy

更新日期:2019-05-25
down
wechat
bug