[darcs-users] Language aware darcs

Sebastian Sylvan sebastian.sylvan at gmail.com
Tue Jan 11 06:19:42 UTC 2005


Hello.
As you may know from my other message to this list, I have yet to
successfully use darcs for my own project, but I have spent some time
reading up on the philosphy behind it.

Anyway, and this may have been discussed before, I was  just curious
on the possibility of adding support for "anguage-aware patches".
So a patch may be "update function X in scope S with [add varialbe V,
asssign to V function call F]" or "changed the modifier of variable X
in class C from private to public" an so on, instead of just being
regular text-changes.

Yes this would require language-specific parsers and other utility
functions, but that's one of the things Haskell really shines at,
right?
Also, I'm not advocating removing the current patch format, just
complementing it. So if something unrecognizable is found darcs falls
back on the current approach. That would even allow a minimalistic
approach to supporting languages (say, you'd only support variables,
scope, and function calls in C++ which would probably resolve most of
the conflicts, even with no real concept of classes or templates
etc.).

The first language candidate would of course be Haskell, so the
feature can be tested on the development of darcs itself. Then at
least som basic support for the "big C-derivatives" (C, C++, Java, C#,
Objective C). Also, parsers and tools for Haskell is readily availble.

I think this would be a killer-app for darcs. I mean it's pretty cool
in that it uses patches and all, so I would prefer it to CVS anyway.
But if it could actually resolve conflicts intelligently (even more
intelligently than a human could reasonably do, assuming a full parser
for the language is available) I would think that even die-hard
CVS-users, for even the most "serious" and "mature" projects, would
switch pretty quickly.

I have no clue of how darcs works internally to know if this would be
feasible, and I can't even begin to think up a nice interface to this
which would allow users to add easily write their own
language-modules. But if it could be done, it would be pretty awesome.

Maybe for darcs 2.0 eh?

/S

-- 
Sebastian Sylvan
+46(0)736-818655
UIN: 44640862




More information about the darcs-users mailing list