TY - JOUR
T1 - A lightweight push-pull mechanism for implicitly using signals in imperative programming
AU - Zhuang, Yung Yu
N1 - Publisher Copyright:
© 2019 Elsevier Ltd
PY - 2019/10
Y1 - 2019/10
N2 - 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.
AB - 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.
KW - Behavior
KW - Event-driven programming
KW - Reactive programming
KW - Signal
UR - http://www.scopus.com/inward/record.url?scp=85067004435&partnerID=8YFLogxK
U2 - 10.1016/j.cola.2019.100903
DO - 10.1016/j.cola.2019.100903
M3 - 期刊論文
AN - SCOPUS:85067004435
SN - 2665-9182
VL - 54
JO - Journal of Computer Languages
JF - Journal of Computer Languages
M1 - 100903
ER -