> Not sure what you mean here — attoparsec does support unlimited
> lookahead, in the sense that a parser may fail arbitrarily late in the
> input stream, and backtrack to any previous state. Although attoparsec
> is a poor choice for programming language parsing, primarily because
> of the error messages.
I guess I have an outdated notion of attoparsec. But yes, error messages
seem to be the weak point of attoparsec. Also, the fact that it only
accepts bytestrings makes it harder (but no impossible, since we can
convert Strings to ByteStrings) to reuse the parser as a QuasiQuoter.
So, I'll rephrase my question. What's the best choice for a library for
parsing programming languages nowadays?

Parsec is still widely popular since it's part of the HP, but I use uu-parsinglib as my first-choice parser.  It comes with a lot of examples, good documentation, and many features I like (good error messages and auto error correction).  I don't know how performance compares with parsec or attoparsec, but it's always been good enough for me.

John L.