[darcs-users] Applying formal descriptions to files

Maurí­cio briqueabraque at yahoo.com
Thu Feb 5 22:13:22 UTC 2009


>> (...)  If I
>> understand properly, a 'metasyntax' allows one to
>> describe unambiguously the structure of a file
>> (please correct me if I'm wrong). I see this, for
>> instance, among many I found in wikipedia:
>> (...)
>> What if we had the option to attach such kind of
>> descriptions (...) to
>> files under darcs control?(...)
> 
> It's been suggested before, but there are a lot of pitfalls and the whole
> thing is much harder than it seems.  (...)
> 
> 1) (...) Not all languages can be described by a CFG. (...)
> - There are no real repositories of well-defined grammars. (...)
> 
> 2) (...) Not all programming results in a well-formed document: (...)
> 
> 3) Converting a parse tree back to text is a whole other ball-game.
 > (...)

I understand your points. But I had in mind that something a lot
more simple could work. When doing Haskell code, for instance, I
wouldn't need a faithfull description of the language. To me,
something like "a set of blocks of code, where consecutive spaces
do not matter except in the beggining of a block, where blocks are
separete by a blank line" would be enough. Of course, my Haskell
layout is unusual -- I type it like Latex, using 'par' to layout
the result -- but that would be fine for me.

In some way, darcs already has a description for text files: a
set of lines. Of course, general pourpose description of Haskell,
C++ or Perl would probably be more difficult that writing a
compiler :) But just beeing able to write something very simple
that we could attach to a file at its creation would be helpfull.
As long as that simple description could transform the file to
a 'canonical' version, even the work of back convertion would be
unnecessary.

Best,
Maurício



More information about the darcs-users mailing list