Bidirectional evaluation with direct manipulation

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.

[1]  Martin Monperrus,et al.  Automatic Software Repair , 2018, ACM Comput. Surv..

[2]  Janis Voigtländer Bidirectionalization for free! (Pearl) , 2009, POPL '09.

[3]  Meng Wang,et al.  HOBiT: Programming Lenses Without Using Lens Combinators , 2018, ESOP.

[4]  Shin-Cheng Mu,et al.  An Algebraic Approach to Bi-directional Updating , 2004, APLAS.

[5]  Jeffrey Heer,et al.  SpanningAspectRatioBank Easing FunctionS ArrayIn ColorIn Date Interpolator MatrixInterpola NumObjecPointI Rectang ISchedu Parallel Pause Scheduler Sequen Transition Transitioner Transiti Tween Co DelimGraphMLCon IData JSONCon DataField DataSc Dat DataSource Data DataUtil DirtySprite LineS RectSprite , 2011 .

[6]  Benjamin C. Pierce,et al.  Local type inference , 1998, POPL '98.

[7]  Éric Tanter,et al.  Processing , 1988 .

[8]  Ben Shneiderman,et al.  Direct Manipulation: A Step Beyond Programming Languages , 1983, Computer.

[9]  James D. Hollan,et al.  Direct Manipulation Interfaces , 1985, Hum. Comput. Interact..

[10]  Meng Wang,et al.  Applicative bidirectional programming with lenses , 2015, ICFP.

[11]  Kazutaka Matsuda,et al.  Bidirectionalizing graph transformations , 2010, ICFP '10.

[12]  Benjamin C. Pierce,et al.  Matching lenses: alignment and view update , 2010, ICFP '10.

[13]  Benjamin C. Pierce,et al.  Combinators for bi-directional tree transformations: a linguistic approach to the view update problem , 2005, POPL '05.

[14]  Tao Xie,et al.  Automating presentation changes in dynamic web applications via collaborative hybrid analysis , 2012, SIGSOFT FSE.

[15]  Shin-Cheng Mu,et al.  An Injective Language for Reversible Computation , 2004, MPC.

[16]  Benjamin C. Pierce,et al.  Boomerang: resourceful lenses for string data , 2008, POPL '08.

[17]  Benjamin C. Pierce,et al.  Local type inference , 2000, TOPL.

[18]  David Walker,et al.  Synthesizing bijective lenses , 2018, Proc. ACM Program. Lang..

[19]  James Cheney,et al.  Lenses for Web Data , 2013, Electron. Commun. Eur. Assoc. Softw. Sci. Technol..

[20]  Frank Tip,et al.  Automated repair of HTML generation errors in PHP applications using string constraint solving , 2012, 2012 34th International Conference on Software Engineering (ICSE).

[21]  Brad A. Myers,et al.  Debugging reinvented , 2008, 2008 ACM/IEEE 30th International Conference on Software Engineering.

[22]  Shinya Kawanaka,et al.  biXid: a bidirectional transformation language for XML , 2006, ICFP '06.

[23]  Ravi Chugh,et al.  Semi-Automated SVG Programming via Direct Manipulation , 2016, UIST.

[24]  Kazutaka Matsuda,et al.  Bidirectionalization transformation based on automatic derivation of view complement functions , 2007, ICFP '07.

[25]  Benjamin C. Pierce,et al.  Relational lenses: a language for updatable views , 2006, PODS '06.

[26]  David Walker,et al.  Synthesizing quotient lenses , 2018, Proc. ACM Program. Lang..

[27]  Dongxi Liu,et al.  Bidirectional interpretation of XQuery , 2007, PEPM '07.

[28]  Robert Bruce Findler,et al.  Slideshow: functional presentations , 2004, ICFP '04.

[29]  HeerJeffrey,et al.  D3 Data-Driven Documents , 2011 .

[30]  Masato Takeichi,et al.  Consistent Web site updating based on bidirectional transformation , 2008, 2008 10th International Symposium on Web Site Evolution.

[31]  B. Myers Debugging Reinvented: Asking and Answering Why and Why Not Questions about Program Behavior , 2008 .

[32]  Ravi Chugh,et al.  Programmatic and direct manipulation, together at last , 2015, PLDI.

[33]  Adam Chlipala,et al.  Strict bidirectional type checking , 2005, TLDI '05.

[34]  Shin-Cheng Mu,et al.  A programmable editor for developing structured documents based on bidirectional transformations , 2004, PEPM '04.