Live coding through WebDAV

This is just a short information to explain how live coding works in lubyk:

webdav

The editor uses WebDAV to change scripts

Morph

When we start a lubyk project, we first launch the “Morph server” with the path to the project’s assets as argument. This server does four important tasks:

  1. Start other processes (eventually on remote machines through “Stem cells”.
  2. Provide processes with patch information and assets (asset server).
  3. Maintain the filesystem in sync with changes in the project. Provides versioning with git.
  4. Provide a WebDAV server to enable live coding.

WebDAV

The WebDAV server (entirely written in Lua) provides network drives which can be mounted on virtually any machine. Once these shares are mounted, when we save changes in the script files or yaml based patch definitions, the content is sent to the Morph server through HTTP by the operating system and Morph forwards the changes to the running processes by using ZeroMQ.

Concretely, this means that:

  1. Users can use any text editor on any machine without prior installation of any plugin or tool to change script content live on a distributed system spanning many machines.
  2. Latency between file save and remote changes is very low.
  3. Many users can live code the same system at the same time.

Cheers !

Gaspard Bucher

comments

  1. leave a comment