It may also relevant to mention the language-theoretic security research program ("LANGSEC"). http://langsec.org/ They've pointed out that the difficulty of parsing, and in a sense our overconfidence that we can just code up parsers for random languages and input formats when we need them, is a pretty pervasive source of security bugs. A lot of those bugs can occur when you have two different parsers that have a diff…
See also this paper: http://www.ieee-security.org/TC/SPW2014/papers/5103a198.PDF . The authors implement a pdf file format parser and find bugs in pretty much all of the existing implementations. Basically pdf is a pretty shitty file format with several ill-defined corner cases. This is one of the reasons PDFs tend to be vectors for security breaches.
http://events.ccc.de/camp/2011/Fahrplan/events/4426.en.html
I went to that talk, and found it to be probably the most advanced and difficult math lecture I'd ever attended! (I was very grateful to see such mathematical sophistication brought to bear to protect PDF users, which is almost all of us.)