[Haskell-cafe] performance question

Nicolas Bock nicolasbock at gmail.com
Thu Feb 14 19:59:51 CET 2013


I have to agree that reading and maintaining regular expressions can be
challenging :)


On Wed, Feb 13, 2013 at 9:50 PM, Erik de Castro Lopo
<mle+hs at mega-nerd.com>wrote:

> wren ng thornton wrote:
>
> > Regexes are powerful and concise for recognizing regular languages. They
> > are not, however, very good for *parsing* regular languages; nor can
> > they handle non-regular languages (unless you're relying on the badness
> > of pcre). In other languages people press regexes into service for
> > parsing because the alternative is using an external DSL like lex/yacc,
> > javaCC, etc. Whereas, in Haskell, we have powerful and concise tools for
> > parsing context-free languages and beyond (e.g., parsec, attoparsec).
>
> This cannot be emphasized heavily enough.
>
> Once you have learnt how to use one or more of these parsec libraries they
> will become your main tool for parsing everything from complex input
> languages
> like haskell itself, all the way down to relatively simple config files.
>
> Parsec style parsers are built up out of small composable (and more
> importantly reusable) combinators, that are easier to read and easier
> to maintain than anything other than the most trivial regex.
>
> Erik
> --
> ----------------------------------------------------------------------
> Erik de Castro Lopo
> http://www.mega-nerd.com/
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20130214/0b2af732/attachment.htm>


More information about the Haskell-Cafe mailing list