Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
97 lines (86 sloc) 4.89 KB
---
timestamp: 2008-07-30 12:34:15
title: in which another mode of collaboration is set forth
tags: "projects ruby"
id: 113
content: "<p>When
Giles <a href='http://gilesbowkett.blogspot.com/2008/06/how-i-got-started-programming.html'>tagged
me</a> with one of these blog memes that's been going around, I
couldn't bring myself to continue its progression since I generally
don't find them all that interesting&mdash;it takes a remarkable
writer to make a good post out of one, but a remarkable writer
probably could have found something interesting to write about
without the meme, while with a less-than-remarkable writer I'd find
a the regular fare (usually a post about code) more interesting than
a biographical sketch.</p>
<p>However, one question in the bunch did stand out to me: <em>what's
the most fun you've had programming</em>? In May of 2006, I
wrote <a href='/45'>a collaborative editing client for Emacs</a>
called <a href='http://github.com/technomancy/dotfiles/tree/master/.emacs.d/ebby.el'>Ebby</a>
in three days. This was my first nontrivial lisp program, and it was
really a rush to dive into the language/environment and come up with
something useful so quickly. Ebby was actually a client for the
existing <a href='http://gobby.0x539.de/trac/'>Obby protocol</a>
which happened to have no documentation at the time, so I spent a
lot of time in <kbd>ettercap</kbd> analyzing traffic in between
banging out lisp functions.</p>
<img src='/i/gobby.png' alt='gobby' title='gobby' align='left' />
<p>While I had loads of fun working on Ebby, one vital feature kept
eluding me. Since I was the only one using Ebby at that point, I was
never able to trigger conflicting edits. Because of this I never saw
the complicated mechanisms in the Obby protocol for dealing with
conflicts. Later someone from the Obby team explained it to me, and
I started implementing it. But it greatly complicated the code since
much more state had to be kept client-side so that conflicting
changes could be rolled back and reapplied on top of the new edits
received from the server. While I was working on this, the Obby team
announced they were eventually going to move to an XMPP-based
protocol that would share virtually no code with the existing
implementation, so I dropped my efforts to fix Ebby. It still worked
quite well with version 0.3 as long as you were on a low-latency
connection, since that kept the likelihood of conflicts low.</p>
<img src='/i/subway.png' alt='all aboard the git subway'
title='all aboard the git subway' class='right' />
<p>Fast-forward to September or so of last year. I was just learning
about <kbd>git</kbd> and how its rebase operation works. I got the
strangest feeling of d&eacute;javu about this until I realized it
was the same rollback-and-reapply operation that I had tried to add
to Ebby. I knew at some point I would want to revisit Ebby, so I
filed this little tidbit away.</p>
<p>Later still at Railsconf '08 a few of the git-addicted hackers got
together to
write <a href='http://rubyforge.org/projects/gitjour'>gitjour</a>, a
tool to share git repositories locally via ZeroConf networking. Once
I found out about this, it was really just a matter of putting the
pieces together before a collaborative editing tool was born out of
it.</p>
<p><b>Conspire</b> is that tool. It builds a realtime repository
synchronization platform on top of gitjour and then provides editor
support on top of that so your edits are automatically committed,
rebased, and refreshed with of the state of the network's conspiracy
session.</p>
<p>As always with new software, there are a number of caveats:</p>
<ul>
<li><b>Conflict resolution is more or less untested</b>. Once again I find
myself in the position of sole conspirator, so it's hard to
simulate conflicting edits.</li>
<li><b>Emacs is the only editor currently supported</b>,
naturally. But should not be hard to add support for your
favourite editor, so give it a go.</li>
<li><b>Installation depends on an unreleased gem</b>, but if you
install the conspire gem from github (after <kbd>sudo apt-get install
libavahi-compat-libdnssd-dev</kbd> on Debian-based systems) it will
pull in my custom up-to-date versions of the dependencies.</li>
<li><b>Conspiracy sessions are currently LAN-only</b>, no Internet
support or NAT-tunneling.</li>
<li><b>I have <i>no idea</i> how it will scale beyond two
conspirators</b>. The synchronization interval parameters could
use some tweaking, to be sure, and it would be great if it could
auto-adjust them based on network latency and number of
conspirators.</li>
</ul>
<p>It currently lives
at <a href='http://github.com/technomancy/conspire'>
http://github.com/technomancy/conspire</a>. As always, patches are
warmly welcomed. Give it a shot: <kbd>sudo gem install conspire
--source=http://gems.github.com</kbd></p>"