3 ms·
I like parser combinators in theory, but I never found a fast parser implementation. Recently in javascript, I resorted to parsing the easy common stuff with a
by nraynaud 12y ago
I like parser combinators in theory, but I never found a fast parser implementation. Recently in javascript, I resorted to parsing the easy common stuff with a fast regex, and the general stuff with the parser combinator.
I had the same problem in java.
- pseudonom- 12y agoAttoparsec is pretty fast. http://www.serpentine.com/blog/2014/05/31/attoparsec/ http://www.serpentine.com/blog/2014/05/31/attoparsec/
- nly 12y agoI do the same in C++. I use Ragel for blasting through regular strings, where little extraction or semantic analysis is required, and use a full-blown recursive descent library for everything else. Parser combinators are elegant but, at the end of the day, I find DSLs like PEGs, Ragels, and good old regex easier to read.