Intent

What is the difference between intent and effect?  

It's tempting, especially for a computer scientist to consider both of these to be similar.  Intent is, after all, just an effect that hasn't happened yet.  

On the other hand, an intent may never happen.  It might happen in one of a number of different ways.  Attempting to describe an intent in terms of its effect (or possible effects) is as like as not to be incredibly inefficient.  This is not at all a new concept -- Databases have, for ages now, supported an access mode that allows users to express their intent as a sequence of operations (i.e., transactions).  Even so, transactions are expressed in terms of effect.  The user says "UPDATE" and the database applies the relevant changes to its state (perhaps without committing them, but the update is still effected)

This is quite helpful.  User code can test the database for its present state, and take actions dictated by the results of those tests.  User code can specify iterations over multiple entries in that state.  It is frequently possible to specify the user's intent far more compactly than the effects of that intent.  Better still, in this way, we can encode the full range of possible effects and outcomes of that intent.

This too is not an entirely novel idea.  Modern, distributed database systems have noticed this nice, friendly, compact encoding, and started allowing users to package their intent into nice little snippets of code to be executed as a transaction.  The code executes on the database, which can guarantee that the user's intent is followed precisely, without the need for (slow) locking, or commit protocols (that may require the user to repeatedly restart their transaction).  The user's intent is seamlessly translated into an effect.

Prepackaged intent is good for interleaving transactions coming from multiple clients.  But what about for actually managing the data itself?  Even these database systems will eventually evaluate the intent, and transform it into a nice flat, easily readable form.  But what if you weren't concerned about reads?  What if you were simply interested in keeping data in synch?  

We started by expressing intent in terms of effect.  Then we moved to a seamless transition between intent and effect.  Why not push things a step further?  Why not express effect in terms of intent?


This page last updated 2024-04-17 21:39:34 -0400