Hammer is a nifty parser combinator library from the people behind Language-Theoretic Security [1].<p>Their goal is to promote the use of context-free formats and protocols, to avoid falling into the trap of trying to parse recursively-enumerable languages, a problem that reduces to the halting problem. The idea is that by sticking to context-free grammars, protocols will be easier to parse, and the bulk of memory corruption errors can eliminated.<p>Meredith Patterson and Sergey Bratus gave an excellent talk on the subject at 28c3 [2], and they've put together a video series on using Hammer to build a secure parser for JSON RPC [3].<p>[1] <a href="http://langsec.org/" rel="nofollow">http://langsec.org/</a><p>[2] <a href="https://www.youtube.com/watch?v=3kEfedtQVOY" rel="nofollow">https://www.youtube.com/watch?v=3kEfedtQVOY</a><p>[3] <a href="https://github.com/sergeybratus/HammerPrimer" rel="nofollow">https://github.com/sergeybratus/HammerPrimer</a>