[darcs-users] darcs and document object models

Ben Franksen ben.franksen at online.de
Fri Apr 16 09:33:49 UTC 2021


Am 15.04.21 um 16:03 schrieb Harald Geyer:
> Has anybody tried to get the patch theory work with xml files in a way,
> that uses DOM semantics. How difficult would it be to implement this?

I don't think this has been tried in the context of Darcs patch theory.
I see no principle difficulty, though. A primitive patch theory can be
built on any "tree like" data type (basically anything that doesn't have
functions embedded within it). You just have to identify the atomic
operations, make sure you represent them with enough context data to
make them invertible, and then think about how they should commute.

> Im mostly interested in the case, where the document objects have some
> kind of (globally) unique ID, which allows us to track how objects are
> added, removed, changed of moved.

That would make it even simpler ;-)

> This would be a huge step towards having things like CAD models under
> meaningful version control.

I agree. It would be nice to have separate "sub-primitive" patch
theories for various file types. Combining these separate "single file"
theories with a generic theory for a tree of directories and files
shouldn't be hard either, we just have to define a patch format that
includes an identifier for the file-specific patch format. The
engineering effort to refactor Darcs along this line is not to be
under-estimated but it may well be worth the effort. The more so since
in fact we already /have/ two separate theories at the "single-file"
level, namely for text files and binary files. The way these are
distinguished nowadays in Darcs is quite ugly and brittle (we match the
file name against a set of patterns; which is okay for deciding the
patch format when recording patches (at least to have a sensible
default), but not when we read or apply or commute patches).

Cheers
Ben
-- 
I would rather have questions that cannot be answered, than answers that
cannot be questioned.  -- Richard Feynman




More information about the darcs-users mailing list