begin quoting Gabriel Sechan as of Tue, Oct 25, 2005 at 05:12:36PM -0500: [snip] > Writing a parser for a spec like XML is hard- thats why most XML parsers > are buggy. Writing a parser for a small domain language is quite easy. > Its a simple state machine. For middle sized languages, you have lex and > yacc. > > The hard part of parsing data isn't the parsing- its dealing with the > tokens after its parsed, and designing a good language to begin with. XML > helps neither of those activities. You still need to deal with the tokens, > you still need to design a good schema. The second one perhaps being the > biggest problem- when you see buggy non-XML parsers, chances are the > language spec is too convoluted. Of course, if they changed it to XML tags > it wouldn't be magicly better- you'd still have a convoluter schema, > wrapped in tags. [snip]
What he said! [snip] > Yup, because just dumping the doc rather than trying to route around the > problem is a great idea. Nah, I didn't really want all that data. So > whats a few missing bank transactions gonna cost anyway? Anything that gets used as a file-storage format should be able to handle corrupted sections. [snip] > There's a reason most real world programs are liberal with inputs- they > have to be. You can't expect the other guy to get his shit right, > especially if he's not employed with you. And failing to the end user is > not a good option, not when the error can be routed around. There's a series of tradeoffs. Low-level needs to be more correct and strict than high level. [snip] > And you could have saved yourself a lot of work in 99% of cases by not > using XML, and not having to worry about the nasty gnarly stuff at all. > Just write a language that does what you need, no more no less. I suspect there's a philosophy difference here. Some people find it easy to invent a new "little language" and are good at it, some people find it easy but aren't good at it, some people find it hard and want to find a meta-language that lets them write one language they can use everywhere. -Stewart -- [email protected] http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg
