[Let's take any further correspondence on this over into Hugs-bugs,
or at least into haskell-cafe ... thanks!]

| When I try to load the parser generated by Happy for a modest-sized
| language into Hugs I get:
| 
| Too many variables (16000) in type checker
| 
| I'm running Hugs 98 on a Power Macintosh.  I increased the constraint
| cutoff limit to no avail (which didn't surprise me).

Right, the constraint cutoff limit isn't a factor here.

| I am unable to increase the heap size (much) above its
| default 250000 cells.  It sounds from the error message,
| though, that 16000 is simply a limit set in the
| Hugs interpreter.

No, it's not an intrinsic limit in Hugs.  The message appears
when a call to malloc (i.e., the memory allocation function
provided by the underlying C implementation) fails.

Perhaps there is a limit in the Mac version of Hugs on the
amount of memory that can be allocated to a program?  Perhaps
the folks that have worked on Mac Hugs can answer this.  Or
perhaps there is a way for you to change memory limits for
Hugs within the MacOS.

| Any ideas on how to make this combination of Happy-generated
| parser and Hugs work together?

Parser generators are good tools for stressing an implementation;
they tend to generate code that no human would ever write, often
with huge groups of mutually recursive functions.  In these days
of multimegabyte machines, the kind of problem you describe doesn't
happen too often any more.  But even on bigger machines, you'll
often see a noticeable pause when Hugs loads the source for a
generated parser.

All the best,
Mark



Reply via email to