Συντάκτης: Simon Hobson Ημερομηνία: Προς: dng Αντικείμενο: Re: [DNG] Detailed technical treatise of systemd
Jonathan Wilkes <jancsika@???> wrote:
> I cannot for the life of me understand the quote from djb starting, "Don't parse."
>
> What is it he doesn't like, and how does his text0 format keep him from doing
> what he doesn't like?
How I read it was ...
Don't have a program you want to be controlled by another program use "human read/writeable" interfaces - use a well defined API.
The problem being that if you use the generic command line interface, you need a parser to accept a variable number of options, in a non-determinate order and combination, and that parser may well have bugs (either in the parser or it's view of what the allowable options are).
In addition, the code you write to generate that arbitrary list of arguments may also have bugs.
So rather than going from an internal well defined structure of what you want to pass, converting it to "human readable text", and parsing it back to an internal well defined structure - just pass the well defined internal structure between the programs using a binary API.
There is probably still some conversion between internal structure and public API at each end, but that's a more tightly defined conversion.
Well that's how I read it anyway. I don't think the text0 format was directly related to this.