Varv #

Reprogrammable Interactive Software as a Declarative Data Structure

Overview #

Varv is a programming model for writing inherently extensible software using a structured declarative representation. We believe software should be malleable and extensible by default. Writing extensible software should not require careful design and architecture choices by software creators and extending existing software should not necessitate sophisticated knowledge of application architecture or development environments from end-users.

Varv obviates the need for software creators to carefully design and craft extension mechanisms by embracing accretive extensibility at the language level. Any Varv program can be extended or modified with new features or capabilities without changing the original source code. Extensibility is built into the language itself. Varv reduces the barrier to entry for end-users to modify software by providing a consistent extensibility interface across all Varv programs. In addition the use of a declarative programming representation is well suited for targeting by higher-level authoring tools.

Varv and its ancillary authoring and debugging tools are in alpha but can already be used to write various interactive applications.

Varv teaser image showing a screenshot of a Varv application containing a todo list. The screenshot has arrows to two Varv files containing text written in JSON and HTML. The Varv files demonstrate syntax, which extends the todo list with functionality to mark todos as done and delete todos. A second screenshot shows the result of applying the code from the Varv files. The same todo list is shown, but the todos have checkboxes and delete buttons.

Example of Varv accretive extensibility: A Varv todo list is extended with two new features: the ability to mark todos as completed and delete todos. The screenshot on the upper left shows the original todo list. The screenshot on the lower right shows the modified todo list with delete buttons and checkboxes for marking todos as done. The Varv code on the upper right adds the ability to delete todos, and the Varv code on the lower left adds the ability to mark todos as done.

Documentation #

To get started writing your own applications in Varv check out some of the following documentation:

  • Examples: A collection of example Varv applications.
  • Tutorial: An introduction to Varv and how to write your own applications in Varv.
  • User Guide: In depth guide to key concepts in Varv.
  • Usage: A guide on how to setup Varv to use it on a Webstrates server.
  • Varv API: Documentation generated for the Varv engine, including descriptions of all standard triggers and actions.

Design Goals #

Varv provides a new vision for software development focused on three design goals.

  • Provide a structured declarative representation of interactive software. The declarative representation allows users to focus primarily on composing domain-specific primitives at a higher level of abstraction while deferring execution concerns to the underlying architecture or runtime. Additionally, declarative representations are well suited for integration with higher-level authoring tools.
  • Enable accretive extensibility by design. All Varv programs can be extended or modified by adding additional files without changes to existing code. All Varv programs are inherently extensible without necessitating careful design choices at authoring time.
  • Decouple application logic from interaction modality. Most programming languages tightly couple input events (e.g., mouse clicks) with resulting state changes (e.g., selecting a game piece). Varv provides mechanisms to decouple application logic from input events, enabling retargeting of an application to multiple interaction modalities or platforms.

Authoring Environment and Architecture #

The Varv engine is written in vanilla JavaScript and can be used standalone on any web page. However, Varv is well suited for collaborative, live programming, and we have created a environment for authoring Varv programs on top of the Webstrates platform and Codestrates code execution and editing framework to suite this purpose.

A diagram of the software stack for the authoring environment, and overall architecture of Varv is shown below.

The foundation of the authoring environment is the Webstrates platform which handles DOM synchronization and persistence. On top of that the Webstrates Package Manager (WPM) enables sharing code between webstrates similar to package managers such as npm for node.js. On top again is codestrates which is a set of WPM packages for executing and editing code. Cauldron is a development and authoring environment built using the functionality provided by codestrates. We have added special functionality to cauldron specific to authoring Varv programs, such as the ability to define Varv concept definition files and inspect instances of Varv concepts in running Varv programs.

On the right side of the diagram is a depiction of the Varv Language’s core architecture, depicting how that various files written in the Varv authoring environment are consumed by the Varv engine. The overall architecture of Varv consists of six main components: the event engine that reads in concept definitions, templates that define how these concepts are rendered in the view layer, and mappings that define where data from concept instances should be stored in the data layer.

Research Paper #

A research paper presenting Varv was published at the ACM CHI 2022 conference. The published paper is available in the ACM Digital Library and the preprint version is available here (PDF).

Marcel Borowski, Luke Murray, Rolf Bagge, Janus Bager Kristensen, Arvind Satyanarayan, and Clemens N. Klokmose. 2022. Varv: Reprogrammable Interactive Software as a Declarative Data Structure. In Proceedings of the 2022 CHI Conference on Human Factors in Computing Systems (CHI ’22).

    author    = {Borowski, Marcel and Murray, Luke and Bagge, Rolf and Kristensen, Janus Bager and Satyanarayan, Arvind and Klokmose, Clemens N.},
    title     = {Varv: Reprogrammable Interactive Software as a Declarative Data Structure},
    year      = {2022},
    booktitle = {Proceedings of the 2022 CHI Conference on Human Factors in Computing Systems},
    series    = {CHI '22},
    doi       = {10.1145/3491102.3502064}

Videos #

CHI 2022 Talk (8 minutes) #

CHI 2022 Video Figure (8 minutes) #

CHI 2022 Video Preview (30 seconds) #

Read More #

You can read much more about Webstrates on the Webstrates website. You can also see our medium post “A brief overview of Webstrates”. You can read more about the codestrates editor used to implement the custom authoring environment for Varv on the Codestrates website.

© 2023 Aarhus University | Made by | Contact Person: Clemens Nylandsted Klokmose