Advertisement

Principles and Practice of Bidirectional Programming in BiGUL

  • Zhenjiang Hu
  • Hsiang-Shang Ko
Chapter
Part of the Lecture Notes in Computer Science book series (LNCS, volume 9715)

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.

Notes

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.

Supplementary material

466700_1_En_4_MOESM1_ESM.zip (6 kb)
Supplementary material 1 (zip 6 KB)

References

  1. 1.
    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
  2. 2.
    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
  3. 3.
    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
  4. 4.
    Diskin, Z., Xiong, 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.a6Google Scholar
  5. 5.
    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_10CrossRefGoogle Scholar
  6. 6.
    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-8CrossRefGoogle Scholar
  7. 7.
    Foster, J.: Bidirectional programming languages. Ph.D. thesis, University of Pennsylvania, December 2009Google Scholar
  8. 8.
    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.1232424CrossRefzbMATHGoogle Scholar
  9. 9.
    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
  10. 10.
    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_1CrossRefGoogle Scholar
  11. 11.
    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
  12. 12.
    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
  13. 13.
    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
  14. 14.
    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
  15. 15.
    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
  16. 16.
    Xiong, 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
  17. 17.
    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
  18. 18.
    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

Copyright information

© Springer International Publishing AG, part of Springer Nature 2018

Authors and Affiliations

  1. 1.National Institute of InformaticsTokyoJapan

Personalised recommendations