There are a lot of advantages to a declarative approach, and a lot of risks and problems with hand written parsers and state machines.<p>A good example is the http code Zed wrote with ragel. From what I remember it was contracted by verisign because they wanted an implementation that actually followed the spec in detail, unlike all other code available at the time. That ragel code has been reused by a lot of embedded http servers in many languages now.