[m-dev.] for review: add support for dumping the MLDS
Ralph Becket
rbeck at microsoft.com
Tue May 9 23:35:28 AEST 2000
> I wrote some code to add support for dumping the MLDS, using Ralph's
> new pprint module. Unfortunately, however, it only works for extremly
> trivial examples (e.g. samples/hello.m), due to performance bugs in
> library/pprint.m. For larger examples (e.g. even samples/calculator.m),
> it takes a very long time and overflows the det stack.
> The problem is lots and lots of recursive calls to pprint:be.
> It may be related to the following comment in pprint.m:
>
> % XXX We could do with a spot of laziness to avoid exponential
> % run-times in the worst case here. The problem is that flatten/1
> % need only be evaluated to the point where it can be decided
> % (by better/4 and fits/2) whether a structure is going to fit on
> % the remainder of the line or not. In practice, eagerness doesn't
> % seem to be a problem.
>
> Should I go ahead and commit this now?
> Or should I wait until we solve the performance problem in pprint?
Yes, given the XXX caveat, I wasn't anticipating anybody trying to
pprint huge structures. There are two ways to solve the problem
(1) wait until Tyson's laziness transformation is up and running or
(2) recode the offending part of pprint.m so we don't get bitten by it.
(2) shouldn't be too hard, although I think it's a bit subtle and will,
inevitably, make the code somewhat more opaque.
How important is this right now?
Cheers,
Ralph
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to: mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions: mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------
More information about the developers
mailing list