[mercury-users] Error detection rate in Mercury vs Other Languages (esp C++ and Python)
Chris King
colanderman at gmail.com
Sun Dec 4 01:51:38 AEDT 2011
On Sat, Dec 3, 2011 at 3:25 AM, Tomas By <tomas at basun.net> wrote:
> (There were performance issues also, I seem to remember, with the
> nondeterministic code, but I guess hw evolution has made that less
> relevant.)
Nope, the performance problems are still there. The trick is to use a
parsing expression grammar instead of a context free grammar, so all
your grammar productions become semidet instead of nondet. You can
then memoize "bottleneck" predicates for incredible speed gains
without having to rearrange code. I followed this discipline while
making the C99 parser and it worked well (C99 I found to be amenable
to conversion to a PEG as it doesn't make use of deep nondeterminism,
so simple rearrangement of some disjunctions sufficed).
The Mercury folk have a paper about this:
http://www.mercury.csse.unimelb.edu.au/information/papers.html#packrat-padl08
--------------------------------------------------------------------------
mercury-users mailing list
Post messages to: mercury-users at csse.unimelb.edu.au
Administrative Queries: owner-mercury-users at csse.unimelb.edu.au
Subscriptions: mercury-users-request at csse.unimelb.edu.au
--------------------------------------------------------------------------
More information about the users
mailing list