1. 12
    1. 3

      In the Actor model, message passing is fundamental. But what we really want, often, is state synchronization: I want some object over there to know about my state over here;

      Uhu, it does seem that this indeed happens fairly frequently. To give an example from my domain, it’s interesting to see how different IDE systems solve this problem, with syntax highlighting as an example (but other features follow similar patterns):

      • Dart analyzer protocol follows pub/sub model: the editor subscribes to file highlighting for a particular set of files, and server pushes highlights when necessary.
      • LSP takes a step back: there’s “get highlights for file” request, which the editor uses to request the information. Naturally, it has the problem that it’s not always clear when new highlights should be requested, and the editor sometimes shows stale results.
      • Rider protocol (which I am least familiar with, as the docs are scarce, so the following might actually be just my imagination) I think has the most principled solution. You define highlighting as a piece of state, mutate it on the server side, and get notifications about updates on the editors side. The protocol underneath sends diffs over the wire, but those raw messages aren’t actually a part of programming model.

Stories with similar links:

  1. Syndicate, an Actor-based language for interactive programs via d_run 6 years ago | 4 points | no comments