Observe and limits

Patrik Jansson patrikj@cs.chalmers.se
Wed, 7 Feb 2001 10:34:48 +0100 (MET)

With observe in the new hugs beta we have an interesting new toy to play
with. I tried observing the state (current character, line and column) of
an (inefficient) monadic expression parser to see the amount of
backtracking, but I immediately ran into the limit on number of
observation tags (400).

I guess I used observe in a way it was not inteded for

  ... observe (show (c,line,col)) c ...

producing lots of tag, each with a few (identical) observations, but
nevertheless it would be nice to have a simpler way of changing the
maximum number of tags than to recompile hugs. (Or at least have a larger
default for big hugs.) (For the record, 4000 was not enough either for
this example.)

When debugging, or performance evaluating using HugsHood it would also be
nice to have a possibility of storing something else than just a list of
observed values. For the parser example (and in many other cases), just
incrementing a tag-specific counter at each evaluation of observe (or a
similar extended function) would be very useful.

/Patrik Jansson