[darcs-users] annotate output

Petr Rockai me at mornfall.net
Mon Sep 6 07:49:19 UTC 2010


Max Battcher <me at worldmaker.net> writes:
> Is it hard to read? Surely \-sequences are not much harder to read than
> existing [_-sequences in darcs. I don't think quote marks subtract much
> readability either (most of us are programmers, after all-- we see quoted
> strings all over the place).

So let's imagine this piece of Haskell (from darcs' Setup.lhs):

    ,"version = \"" ++ version ++ " (" ++ state ++ ")\""

the YAML rendition of said is this:

    ",\"version = \\\"\" ++ version ++ \" (\" ++ state ++ \")\\\"\""

so we'd better hope that you never run into a non-printable character,
or you could get seriously confused (as a human).

Anyway, all this bik^Wproductive discussion is moot, until someone gets
us a YAML writer that we could actually use. You don't imagine we are
going to implement and test all that quoting logic, right?

> Everything in UTF-8 not explicitly excluded is fair game in a literal
> block... How likely are non-binary files to contain characters in the
> proscribed ranges? Certainly darcs could check for the proscribed ranges and
> switch to a quoted format only when truly necessary.

Right, which makes the format really deceitful, because it (most of the
time, anyway) looks simple, while sometimes it'll revert to this really
tricky escaping behaviour. Again, this is something that a ~single line
of perl / shell / awk / python / haskell could parse 100 % reliably if
we only used a simple format instead of YAML.

So YAML:
- more code on both producer and consumer side (both with and without
  YAML lib)
- parsing is buggy when not using real YAML parser (triggers rarely though)
- non-printable characters make the surrounding text barely readable
- extra external dependency for reliable parsing
- no code for YAML yet (whereas the regex-parseable output exists and is
  7 lines of Haskell (I wish one of the YAML proponents would implement
  the proposal so we can compare notes)

Yours,
   Petr.

PS: I find it curios, if somewhat amusing, how nothing happened with the
annotate output for a couple years, until someone re-implements it with
a new output format. All of sudden, everyone has an opinion on how
should the output look...


More information about the darcs-users mailing list