Abstract
We present an evaluation update (or simply, update) algorithm for a full-featured functional programming language, which synthesizes program changes based on output changes. Intuitively, the update algorithm retraces the steps of the original evaluation, rewriting the program as needed to reconcile differences between the original and updated output values. Our approach, furthermore, allows expert users to define custom lenses that augment the update algorithm with more advanced or domain-specific program updates.
To demonstrate the utility of evaluation update, we implement the algorithm in Sketch-n-Sketch, a novel direct manipulation programming system for generating HTML documents. In Sketch-n-Sketch, the user writes an ML-style functional program to generate HTML output. When the user directly manipulates the output using a graphical user interface, the update algorithm reconciles the changes. We evaluate bidirectional evaluation in Sketch-n-Sketch by authoring ten examples comprising approximately 1400 lines of code in total. These examples demonstrate how a variety of HTML documents and applications can be developed and edited interactively in Sketch-n-Sketch, mitigating the tedious edit-run-view cycle in traditional programming environments.
Supplemental Material
- Davi M. J. Barbosa, Julien Cretin, Nate Foster, Michael Greenberg, and Benjamin C. Pierce. 2010. Matching Lenses: Alignment and View Update. In International Conference on Functional Programming (ICFP). Google ScholarDigital Library
- Aaron Bohannon, J. Nathan Foster, Benjamin C. Pierce, Alexandre Pilkiewicz, and Alan Schmitt. 2008. Boomerang: Resourceful Lenses for String Data. In Symposium on Principles of Programming Languages (POPL). Google ScholarDigital Library
- Aaron Bohannon, Jeffrey A. Vaughan, and Benjamin C. Pierce. 2006. Relational Lenses: A Language for Updateable Views. In Principles of Database Systems (PODS). Google ScholarDigital Library
- Michael Bostock, Vadim Ogievetsky, and Jeffrey Heer. 2011. D3: Data-Driven Documents. IEEE Transactions on Visualization and Computer Graphics (VIS) (2011). Google ScholarDigital Library
- Adam Chlipala, Leaf Petersen, and Robert Harper. 2005. Strict Bidirectional Type Checking. In Workshop on Types in Languages Design and Implementation (TLDI) . Google ScholarDigital Library
- Ravi Chugh, Brian Hempel, Mitchell Spradlin, and Jacob Albers. 2016. Programmatic and Direct Manipulation, Together at Last. In Conference on Programming Language Design and Implementation (PLDI). Google ScholarDigital Library
- Robert Bruce Findler and Matthew Flatt. 2006. Slideshow: Functional Presentations. Journal of Functional Programming (2006). 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. ACM Transactions on Programming Languages and Systems (TOPLAS) 29, 3 (2007). Google ScholarDigital Library
- Brian Hempel and Ravi Chugh. 2016. Semi-Automated SVG Programming via Direct Manipulation. In Symposium on User Interface Software and Technology (UIST) . Google ScholarDigital Library
- Soichiro Hidaka, Zhenjiang Hu, Kazuhiro Inaba, Hiroyuki Kato, Kazutaka Matsuda, and Keisuke Nakano. 2010. Bidirectionalizing Graph Transformations. In International Conference on Functional Programming (ICFP). Google ScholarDigital Library
- Zhenjiang Hu, Shin-Cheng Mu, and Masato Takeichi. 2008. A Programmable Editor for Developing Structured Documents Based on Bidirectional Transformations. Higher-Order and Symbolic Computation (2008). Google ScholarDigital Library
- Edwin L. Hutchins, James D. Hollan, and Donald A. Norman. 1985. Direct Manipulation Interfaces. Human-Computer Interaction (1985). Google ScholarDigital Library
- Shinya Kawanaka and Haruo Hosoya. 2006. biXid: A Bidirectional Transformation Language for XML. In International Conference on Functional Programming (ICFP) . Google ScholarDigital Library
- Andrew J. Ko and Brad A. Myers. 2008. Debugging Reinvented: Asking and Answering Why and Why Not Questions About Program Behavior. In International Conference on Software Engineering (ICSE). Google ScholarDigital Library
- Dongxi Liu, Zhenjiang Hu, and Masato Takeichi. 2007. Bidirectional Interpretation of XQuery. In Symposium on Partial Evaluation and Semantics-based Program Manipulation (PEPM) . Google ScholarDigital Library
- Solomon Maina, Anders Miltner, Kathleen Fisher, Benjamin C. Pierce, David Walker, and Steve Zdancewic. 2018. Synthesizing Quotient Lenses. Proceedings of the ACM on Programming Languages (PACMPL), Issue ICFP (2018). Google ScholarDigital Library
- Kazutaka Matsuda, Zhenjiang Hu, Keisuke Nakano, Makoto Hamana, and Masato Takeichi. 2007. Bidirectionalization Transformation Based on Automatic Derivation of View Complement Functions. In International Conference on Functional Programming (ICFP) . Google ScholarDigital Library
- Kazutaka Matsuda and Meng Wang. 2015. Applicative Bidirectional Programming with Lenses. In International Conference on Functional Programming (ICFP) . Google ScholarDigital Library
- Kazutaka Matsuda and Meng Wang. 2018. HOBiT: Programming Lenses Without Using Lens Combinators. In European Symposium on Programming (ESOP) .Google Scholar
- Mikaël Mayer, Viktor Kunčak, and Ravi Chugh. 2018. Bidirectional Evaluation with Direct Manipulation. (2018). Extended version of OOPSLA 2018 paper available as forthcoming CoRR report. Google ScholarDigital Library
- Anders Miltner, Kathleen Fisher, Benjamin C. Pierce, David Walker, and Steve Zdancewic. 2018. Synthesizing Bijective Lenses. Proceedings of the ACM on Programming Languages (PACMPL), Issue POPL (2018). Google ScholarDigital Library
- Martin Monperrus. 2018. Automatic Software Repair: A Bibliography. Comput. Surveys (2018). Google ScholarDigital Library
- Shin-Cheng Mu, Zhenjiang Hu, and Masato Takeichi. 2004a. An Algebraic Approach to Bi-directional Updating. In Asian Symposium on Programming Languages and Systems (APLAS) .Google ScholarCross Ref
- Shin-Cheng Mu, Zhenjiang Hu, and Masato Takeichi. 2004b. An Injective Language for Reversible Computation. In Conference on Mathematics of Program Construction (MPC) .Google Scholar
- Keisuke Nakano, Zhenjiang Hu, and Masato Takeichi. 2009. Consistent Web Site Updating Based on Bidirectional Transformation. International Journal on Software Tools for Technology Transfer (Web Site Evolution 2008) (2009).Google Scholar
- Benjamin C. Pierce and David N. Turner. 2000. Local Type Inference. ACM Transactions on Programming Languages and Systems (TOPLAS) (2000). Google ScholarDigital Library
- Guillaume Pothier, Éric Tanter, and José Piquer. 2007. Scalable Omniscient Debugging. In Object-Oriented Programming Systems and Applications (OOPSLA) . Google ScholarDigital Library
- Raghu Rajkumar, Nate Foster, Sam Lindley, and James Cheney. 2014. Lenses for Web Data. Electronic Communications of the EASST (Bidirectional Transformations 2013) (2014).Google Scholar
- Hesam Samimi, Max Schäfer, Shay Artzi, Todd Millstein, Frank Tip, and Laurie Hendren. 2012. Automated Repair of HTML Generation Errors in PHP Applications using String Constraint Solving. In International Conference on Software Engineering (ICSE) . Google ScholarDigital Library
- Ben Shneiderman. 1983. Direct Manipulation: A Step Beyond Programming Languages. Computer (August 1983). Google ScholarDigital Library
- Janis Voigtländer. 2009. Bidirectionalization for Free! (Pearl). In Symposium on Principles of Programming Languages (POPL). Google ScholarDigital Library
- Xiaoyin Wang, Lu Zhang, Tao Xie, Yingfei Xiong, and Hong Mei. 2012. Automating Presentation Changes in Dynamic Web Applications via Collaborative Hybrid Analysis. In Symposium on the Foundations of Software Engineering (FSE). Google ScholarDigital Library
Index Terms
- Bidirectional evaluation with direct manipulation
Recommendations
Programmatic and direct manipulation, together at last
PLDI '16Direct manipulation interfaces and programmatic systems have distinct and complementary strengths. The former provide intuitive, immediate visual feedback and enable rapid prototyping, whereas the latter enable complex, reusable abstractions. ...
Programmatic and direct manipulation, together at last
PLDI '16: Proceedings of the 37th ACM SIGPLAN Conference on Programming Language Design and ImplementationDirect manipulation interfaces and programmatic systems have distinct and complementary strengths. The former provide intuitive, immediate visual feedback and enable rapid prototyping, whereas the latter enable complex, reusable abstractions. ...
Graphical styles for building interfaces by demonstration
UIST '92: Proceedings of the 5th annual ACM symposium on User interface software and technologyConventional interface builders allow the user interface designer to select widgets such as menus, buttons and scroll bars, and lay them out using a mouse. Although these are conceptually simple to use, in practice there are a number of problems. First, ...
Comments