A lightweight push-pull mechanism for implicitly using signals in imperative programming

被引:4
作者
Zhuang, YungYu [1 ]
机构
[1] Natl Cent Univ, Dept Comp Sci & Informat Engn, 300 Zhongda Rd, Taoyuan 32001, Taiwan
关键词
Event-driven programming; Reactive programming; Signal; Behavior;
D O I
10.1016/j.cola.2019.100903
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
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.
引用
收藏
页数:12
相关论文
共 38 条
[1]  
[Anonymous], API AS PROGR OBS STR
[2]  
COOPER GH, 2006, ESOP 06, V3924, P294
[3]  
Courtney A., 2001, Practical Aspects of Declarative Languages. Third International Symposium, PADL 2001. Proceedings (Lecture Notes in Computer Science Vol.1990), P29
[4]  
Dijkstra Edsger., 1982, SELECTED WRITINGS CO
[5]   Functional reactive animation [J].
Elliott, C ;
Hudak, P .
ACM SIGPLAN NOTICES, 1997, 32 (08) :263-273
[6]  
ELLIOTT C, 2009, P 2 ACM SIGPLAN S HA, P25, DOI DOI 10.1145/1596638.159664
[7]  
Gamma E., 1994, DESIGN PATTERNS
[8]  
Gasiunas Vaidas, 2011, P 10 INT C ASP OR SO, P227, DOI 10.1145/1960275.1960303
[9]   Design pattern implementation in Java']Java and AspectJ [J].
Hannemann, J ;
Kiczales, G .
ACM SIGPLAN NOTICES, 2002, 37 (11) :161-173
[10]  
Kamina Tetsuo, 2018, The Art, Science, and Engineering of Programming, V2, P3, DOI [10.22152/programmingjournal.org/2018/2/5, DOI 10.22152/PROGRAMMINGJOURNAL.ORG/2018/2/5]