HOBiT: Programming Lenses without using Lens Combinators

Kazutaka Matsuda, Meng Wang

Research output: Chapter in Book/Report/Conference proceedingConference Contribution (Conference Proceeding)

7 Citations (Scopus)
274 Downloads (Pure)

Abstract

We propose HOBiT, a higher-order bidirectional programming language, in which users can write bidirectional programs in the familiar style of conventional functional programming, while enjoying the full expressiveness of lenses. A bidirectional transformation, or a lens, is a pair of mappings between source and view data objects, one in each direction. When the view is modified, the source is updated accordingly with respect to some laws—a pattern that is found in databases, model-driven development, compiler construction, and so on. The most common way of programming lenses is with lens combinators, which are lens-to-lens functions that compose simpler lenses to form more complex ones. Lens combinators preserve the bidirectionality of lenses and are expressive; but they compel programmers to a specialised point-free style—i.e., no naming of intermediate computation results—limiting the scalability of bidirectional programming. To address this issue, we propose a new bidirectional programming language HOBiT, in which lenses are represented as standard functions, and combinators are mapped to language constructs with binders. This design transforms bidirectional programming, enabling programmers to write bidirectional programs in a flexible functional style and at the same time access the full expressiveness of lenses. We formally define the syntax, type system, and the semantics of the language, and then show that programs in HOBiT satisfy bidirectionality. Additionally, we demonstrate HOBiT ’s programmability with examples.
Original languageEnglish
Title of host publicationProgramming Languages and Systems
Subtitle of host publication27th European Symposium on Programming, ESOP 2018, Held as Part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2018, Thessaloniki, Greece, April 14-20, 2018, Proceedings
PublisherSpringer, Cham
Pages31-59
Number of pages19
ISBN (Electronic)9783319898841
ISBN (Print)9783319898834
DOIs
Publication statusPublished - 14 Apr 2018
EventEuropean Symposium on Programming 2018: ESOP 2018 - Thessaloniki, Greece
Duration: 14 Apr 201821 Apr 2018

Publication series

Name Lecture Notes in Computer Science
PublisherSpringer
Volume10801
ISSN (Print)0302-9743

Conference

ConferenceEuropean Symposium on Programming 2018
CountryGreece
CityThessaloniki
Period14/04/1821/04/18

Structured keywords

  • Programming Languages

Fingerprint Dive into the research topics of 'HOBiT: Programming Lenses without using Lens Combinators'. Together they form a unique fingerprint.

Cite this