
Can anyone briefly compare these two parsing-libraries? In short, which one is better? /S -- Sebastian Sylvan +46(0)736-818655 UIN: 44640862

Hi, So far I did not regret using Parsec for a huge language (like CASL http://www.tzi.de/cofi). Compared to other combinator parser libraries, I think, it is best documented and the fastest (if used sensibly). Error reporting could be better, but it is already better than that of happy. Usually, one does not want to stop at the first parse error, but rather try to collect several errors (that are not caused by previous ones). I assume, alex and happy generated code will be faster. (I did not try to use a seperate lexer with Parsec.) But a slow-down of the parser (say by a factor of up to 3) is usually no problem. Much more time is spent elsewhere. One disadvantage of combinator parsers is that the "grammar" is not as visible as in a happy file and needs more tuning (left factorization, etc.). The major advantage is the great flexibility in combining parsing and other computations (possibly for lookaheads or dependent parsing) in one formalism (i.e. pure hasekll in a single module). (The yacc features like precendences and associativities in grammar rules do not help much for user-definable precendences like in haskell.) Christian

On Wed, Oct 19, 2005 at 11:40:27AM +0200, Sebastian Sylvan wrote:
Can anyone briefly compare these two parsing-libraries?
In short, which one is better?
I like the ideas behind ReadP much more. if one were to write a feature-complete parser based on its model I think it would be ideal. John -- John Meacham - ⑆repetae.net⑆john⑈
participants (3)
-
Christian Maeder
-
John Meacham
-
Sebastian Sylvan