Abstract
Bidirectional live programming systems (BLP) enable developers to modify a program by directly manipulating the program output, so that the updated program can produce the manipulated output. One state-of-the-art approach to BLP systems is operation-based, which captures the developer's intention of program modifications by taking how the developer manipulates the output into account. The program modifications are usually hard coded for each direct manipulation in these BLP systems, which are difficult to extend. Moreover, to reflect the manipulations to the source program, these BLP systems trace the modified output to appropriate code fragments and perform corresponding code transformations. Accordingly, they require direct manipulation users be aware of the source code and how it is changed, making "direct" manipulation (on output) be "indirect".
In this paper, we resolve this problem by presenting a novel operation-based framework for bidirectional live programming, which can automatically fuse direct manipulations into the source code, thus supporting code-insensitive direct manipulations. Firstly, we design a simple but expressive delta language DM capable of expressing common direct manipulations for output values. Secondly, we present a fusion algorithm that propagates direct manipulations into the source functional programs and applies them to the constants whenever possible; otherwise, the algorithm embeds manipulations into the "proper positions" of programs. We prove the correctness of the fusion algorithm that the updated program executes to get the manipulated output. To demonstrate the expressiveness of DM and the effectiveness of our fusion algorithm, we have implemented FuseDM, a prototype SVG editor that supports GUI-based operations for direct manipulation, and successfully designed 14 benchmark examples starting from blank code using FuseDM.
- F. Bancilhon and N. Spyratos. 1981. Update Semantics of Relational Views. ACM Trans. Database Syst., 6, 4 (1981), dec, 557–575. issn:0362-5915 https://doi.org/10.1145/319628.319634 Google ScholarDigital Library
- Wei-Ngan Chin. 1992. Safe Fusion of Functional Expressions. SIGPLAN Lisp Pointers, V, 1 (1992), jan, 11–20. issn:1045-3563 https://doi.org/10.1145/141478.141494 Google ScholarDigital Library
- Ravi Chugh, Brian Hempel, Mitchell Spradlin, and Jacob Albers. 2016. Programmatic and direct manipulation, together at last. Proceedings of the 37th ACM SIGPLAN Conference on Programming Language Design and Implementation, Jun, https://doi.org/10.1145/2908080.2908103 Google ScholarDigital Library
- Evan Czaplicki. 2012. Elm: A delightful language for reliable webapps. https://elm-lang.org/ Accessed: 2023-07-04 Google Scholar
- Krzysztof Czarnecki, Nate Foster, Zhenjiang Hu, Ralf Lämmel, Andy Schürr, and James Terwilliger. 2009. Bidirectional Transformations: A Cross-Discipline Perspective. 5563, 260–283. isbn:978-3-642-02407-8 https://doi.org/10.1007/978-3-642-02408-5_19 Google ScholarDigital Library
- Zinovy Diskin, Yingfei Xiong, and Krzysztof Czarnecki. 2010. From State- to Delta-Based Bidirectional Model Transformations. In Proceedings of the Third International Conference on Theory and Practice of Model Transformations (ICMT’10). Springer-Verlag, Berlin, Heidelberg. 61–76. isbn:3642136877 Google ScholarDigital Library
- Zinovy Diskin, Yingfei Xiong, Krzysztof Czarnecki, Hartmut Ehrig, Frank Hermann, and Fernando Orejas. 2011. From State- to Delta-Based Bidirectional Model Transformations: The Symmetric Case. In Proceedings of the 14th International Conference on Model Driven Engineering Languages and Systems (MODELS’11). Springer-Verlag, Berlin, Heidelberg. 304–318. isbn:9783642244841 Google ScholarDigital Library
- J. Nathan Foster, Michael B. Greenwald, Jonathan T. Moore, Benjamin C. Pierce, and Alan Schmitt. 2007. Combinators for Bidirectional Tree Transformations: A Linguistic Approach to the View-Update Problem. 29, 3 (2007), may, 17–es. issn:0164-0925 https://doi.org/10.1145/1232420.1232424 Google ScholarDigital Library
- Koumei Fukahori, Daisuke Sakamoto, Jun Kato, and Takeo Igarashi. 2014. CapStudio: An Interactive Screencast for Visual Application Development. Conference on Human Factors in Computing Systems - Proceedings, isbn:978-1-4503-2474-8 https://doi.org/10.1145/2559206.2581138 Google ScholarDigital Library
- Brian Hempel and Ravi Chugh. 2016. Semi-Automated SVG Programming via Direct Manipulation. In Proceedings of the 29th Annual Symposium on User Interface Software and Technology (UIST ’16). Association for Computing Machinery, New York, NY, USA. 379–390. isbn:9781450341899 https://doi.org/10.1145/2984511.2984575 Google ScholarDigital Library
- Brian Hempel, Justin Lubin, and Ravi Chugh. 2019. Sketch-n-Sketch: Output-Directed Programming for SVG. In Proceedings of the 32nd Annual ACM Symposium on User Interface Software and Technology (UIST ’19). Association for Computing Machinery, New York, NY, USA. 281–292. isbn:9781450368162 https://doi.org/10.1145/3332165.3347925 Google ScholarDigital Library
- Martin Hofmann, Benjamin Pierce, and Daniel Wagner. 2012. Edit Lenses. In Proceedings of the 39th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL ’12). Association for Computing Machinery, New York, NY, USA. 495–508. isbn:9781450310833 https://doi.org/10.1145/2103656.2103715 Google ScholarDigital Library
- Mikaël Mayer, Viktor Kuncak, and Ravi Chugh. 2018. Bidirectional Evaluation with Direct Manipulation. Proc. ACM Program. Lang., 2, OOPSLA (2018), Article 127, oct, 28 pages. https://doi.org/10.1145/3276497 Google ScholarDigital Library
- Sergey Melnik, Atul Adya, and Philip A. Bernstein. 2008. Compiling Mappings to Bridge Applications and Databases. ACM Trans. Database Syst., 33, 4 (2008), Article 22, dec, 50 pages. issn:0362-5915 https://doi.org/10.1145/1412331.1412334 Google ScholarDigital Library
- Atsushi Ohori and Isao Sasano. 2007. Lightweight Fusion by Fixed Point Promotion. In Proceedings of the 34th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL ’07). Association for Computing Machinery, New York, NY, USA. 143–154. isbn:1595935754 https://doi.org/10.1145/1190216.1190241 Google ScholarDigital Library
- Armando Solar-Lezama. 2008. Program synthesis by sketching. University of California, Berkeley. Google ScholarDigital Library
- Akihiko Takano and Erik Meijer. 1995. Shortcut Deforestation in Calculational Form. In Proceedings of the Seventh International Conference on Functional Programming Languages and Computer Architecture (FPCA ’95). Association for Computing Machinery, New York, NY, USA. 306–313. isbn:0897917197 https://doi.org/10.1145/224164.224221 Google ScholarDigital Library
- Vlad Ureche, Aggelos Biboudis, Yannis Smaragdakis, and Martin Odersky. 2015. Automating Ad Hoc Data Representation Transformations. SIGPLAN Not., 50, 10 (2015), oct, 801–820. issn:0362-1340 https://doi.org/10.1145/2858965.2814271 Google ScholarDigital Library
- H. von Koch. 1904. Sur une courbe continue sans tangente obtenue par une construction geometrique elementaire. Norstedt & soner. https://books.google.com.hk/books?id=kf3NnQAACAAJ Google Scholar
- Philip Wadler. 1988. Deforestation: Transforming Programs to Eliminate Trees. Theor. Comput. Sci., 73, 2 (1988), jan, 231–248. issn:0304-3975 https://doi.org/10.1016/0304-3975(90)90147-A Google ScholarDigital Library
- Xing Zhang, Guanchen Guo, Xiao He, and Zhenjiang Hu. 2023. Bidirectional Object-Oriented Programming: Towards Programmatic and Direct Manipulation of Objects. Proc. ACM Program. Lang., 7, OOPSLA1 (2023), Article 83, apr, 26 pages. https://doi.org/10.1145/3586035 Google ScholarDigital Library
- Xing Zhang and Zhenjiang Hu. 2022. Towards Bidirectional Live Programming for Incomplete Programs. In Proceedings of the 44th International Conference on Software Engineering (ICSE ’22). Association for Computing Machinery, New York, NY, USA. 2154–2164. isbn:9781450392211 https://doi.org/10.1145/3510003.3510195 Google ScholarDigital Library
- Xing Zhang, Ruifeng Xie, Guanchen Guo, Xiao He, Tao Zan, and Zhenjiang Hu. 2023. FuseDM. https://doi.org/10.5281/zenodo.8419913 Google ScholarCross Ref
Index Terms
- Fusing Direct Manipulations into Functional Programs
Recommendations
Direct manipulation through surrogate objects
CHI '11: Proceedings of the SIGCHI Conference on Human Factors in Computing SystemsDirect manipulation has had major influence on interface design since it was proposed by Shneiderman in 1982. Although directness generally benefits users, direct manipulation also has weaknesses. In some cases, such as when a user needs to manipulate ...
Redirecting direct manipulation or what happens when the goal is in front of you but the interface says to turn left?
CHI EA '99: CHI '99 Extended Abstracts on Human Factors in Computing SystemsThe feeling of directness arises when the interface permits the user to manipulate an interface object in a way analogous to manipulating the real object. However, we argue here that the essence of direct manipulation is not directness per se, but ...
Generating Direct Manipulation Program Editors
OZCHI '96: Proceedings of the 6th Australian Conference on Computer-Human Interaction (OZCHI '96)Abstract: Language specific editors are cognisant of the syntax and semantics of the programming language they manipulate. Despite the various potential advantages of language specific editors, they have not been widely accepted by software developers ...
Comments