3 ms·
hard to see how this really faster (and less bug prone) than generating one with Ragel. Hm, I actually think the opposite (except for the point about bugs). A
by quacker 12y ago
hard to see how this really faster (and less bug prone) than generating one with Ragel.
Hm, I actually think the opposite (except for the point about bugs). A hand-crafted parser can easily be faster than a generic parser because:
* You aren't limited to implementing a regular grammar
* You can guarantee no overhead is introduced by the parsing tool
* You have complete freedom to optimize at the lowest levels
Now, I've never used Ragel, so I'm speaking from my experience with other parser generators (and from the perspective of a programming language implementation). I'd be interested to know if Ragel is different with regard to any of these points.
- nly 12y ago> I'd be interested to know if Ragel is different with regard to any of these points. It'll do a better job than you will at reducing DFAs to their optimal representation. Imho, with careful use of its pragmas, it produces pretty much optimal code when using -G2 (goto based code generation). Another really nice feature is being able to dump the DFA to a dot file and render it using Graphviz.