Abstract
Putback-based bidirectional programming allows the programmer to write only one backward transformation, from which the unique corresponding forward transformation is derived for free. A key distinguishing feature of putback-based bidirectional programming is full control over the bidirectional behavior, which is important for specifying intended bidirectional transformations without any ambiguity. In this chapter, we will introduce BiGUL, a simple yet powerful putback-based bidirectional programming language, explaining the underlying principles and showing how various kinds of bidirectional application can be developed in BiGUL.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Similar content being viewed by others
References
Barbosa, D.M.J., Cretin, J., Foster, J.N., Greenberg, M., Pierce, B.C.: Matching lenses: alignment and view update. In: International Conference on Functional Programming, pp. 193–204. ACM (2010). https://doi.org/10.1145/1863543.1863572
Bohannon, A., Foster, J.N., Pierce, B.C., Pilkiewicz, A., Schmitt, A.: Boomerang: resourceful lenses for string data. In: Symposium on Principles of Programming Languages, pp. 407–419. ACM (2008). https://doi.org/10.1145/1328438.1328487
Bohannon, A., Pierce, B.C., Vaughan, J.A.: Relational lenses: a language for updatable views. In: Symposium on Principles of Database Systems, pp. 338–347. ACM (2006). https://doi.org/10.1145/1142351.1142399
Diskin, Z., **ong, Y., Czarnecki, K.: From state- to delta-based bidirectional model transformations: the asymmetric case. J. Object Technol. 10(6), 6:1–6:25 (2011). https://doi.org/10.5381/jot.2011.10.1.a6
Fischer, S., Hu, Z., Pacheco, H.: A clear picture of lens laws. In: Hinze, R., Voigtländer, J. (eds.) MPC 2015. LNCS, vol. 9129, pp. 215–223. Springer, Cham (2015). https://doi.org/10.1007/978-3-319-19797-5_10
Fischer, S., Hu, Z., Pacheco, H.: The essence of bidirectional programming. Sci. China Inf. Sci. 58(5), 1–21 (2015). https://doi.org/10.1007/s11432-015-5316-8
Foster, J.: Bidirectional programming languages. Ph.D. thesis, University of Pennsylvania, December 2009
Foster, J.N., Greenwald, M.B., Moore, J.T., Pierce, B.C., Schmitt, A.: Combinators for bidirectional tree transformations: a linguistic approach to the view-update problem. ACM Trans. Program. Lang. Syst. 29(3), 17 (2007). https://doi.org/10.1145/1232420.1232424
Hidaka, S., Hu, Z., Inaba, K., Kato, H., Matsuda, K., Nakano, K.: Bidirectionalizing graph transformations. In: International Conference on Functional Programming, pp. 205–216. ACM (2010). https://doi.org/10.1145/1932681.1863573
Hu, Z., Pacheco, H., Fischer, S.: Validity checking of putback transformations in bidirectional programming. In: Jones, C., Pihlajasaari, P., Sun, J. (eds.) FM 2014. LNCS, vol. 8442, pp. 1–15. Springer, Cham (2014). https://doi.org/10.1007/978-3-319-06410-9_1
Ko, H.S., Zan, T., Hu, Z.: BiGUL: a formally verified core language for putback-based bidirectional programming. In: Workshop on Partial Evaluation and Program Manipulation, pp. 61–72. ACM (2016). https://doi.org/10.1145/2847538.2847544
Matsuda, K., Hu, Z., Nakano, K., Hamana, M., Takeichi, M.: Bidirectionalization transformation based on automatic derivation of view complement functions. In: International Conference on Functional Programming, pp. 47–58. ACM (2007). https://doi.org/10.1145/1291220.1291162
Pacheco, H., Hu, Z., Fischer, S.: Monadic combinators for “putback” style bidirectional programming. In: Workshop on Partial Evaluation and Program Manipulation, pp. 39–50. ACM (2014). https://doi.org/10.1145/2543728.2543737
Pacheco, H., Zan, T., Hu, Z.: BiFluX: a bidirectional functional update language for XML. In: International Symposium on Principles and Practice of Declarative Programming, pp. 147–158 (2014). https://doi.org/10.1145/2643135.2643141
Voigtländer, J.: Bidirectionalization for free! In: Symposium on Principles of Programming Languages, pp. 165–176. ACM (2009). https://doi.org/10.1145/1480881.1480904
**ong, Y., Liu, D., Hu, Z., Zhao, H., Takeichi, M., Mei, H.: Towards automatic model synchronization from model transformations. In: International Conference on Automated Software Engineering, pp. 164–173. ACM (2007). https://doi.org/10.1145/1321631.1321657
Zan, T., Liu, L., Ko, H.S., Hu, Z.: Brul: a putback-based bidirectional transformation library for updatable views. In: International Workshop on Bidirectional Transformations, pp. 77–89. CEUR-WS (2016). http://ceur-ws.org/Vol-1571/paper_3.pdf
Zhu, Z., Zhang, Y., Ko, H.S., Martins, P., Saraiva, J., Hu, Z.: Parsing and reflective printing, bidirectionally. In: International Conference on Software Language Engineering, pp. 2–14. ACM (2016). https://doi.org/10.1145/2997364.2997369
Acknowledgements
We would like to thank James Cheney, Jeremy Gibbons, and, in particular, Anthony Anjorin for their meticulous and helpful comments on this paper. This work is supported by JSPS Grant-in-Aid for Scientific Research (A) No. 25240009 of Japan, the Nation Basic Research Program (973 Program) of China under Grant No. 2015CB352201, and the National Natural Science Foundation of China under Grant No. 61620106007.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
1 Electronic supplementary material
Below is the link to the electronic supplementary material.
Rights and permissions
Copyright information
© 2018 Springer International Publishing AG, part of Springer Nature
About this chapter
Cite this chapter
Hu, Z., Ko, HS. (2018). Principles and Practice of Bidirectional Programming in BiGUL. In: Gibbons, J., Stevens, P. (eds) Bidirectional Transformations. Lecture Notes in Computer Science(), vol 9715. Springer, Cham. https://doi.org/10.1007/978-3-319-79108-1_4
Download citation
DOI: https://doi.org/10.1007/978-3-319-79108-1_4
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-79107-4
Online ISBN: 978-3-319-79108-1
eBook Packages: Computer ScienceComputer Science (R0)