[m-users.] Stackoverflow from --intermodule-optimisation
Michael Day
mikeday at yeslogic.com
Wed Sep 25 16:49:04 AEST 2013
Hi Julien,
> IMO, such code should be re-written to avoid the stack overflow.
> Having your code rely on a particular optimization being enabled for
> completeness is a terribly brittle approache.
In that case there would be no point to have the optimisation at all, if
it is unsafe to write any code that could benefit from it.
This optimisation guarantees constant stack space for functions /
predicates that fit a certain syntactic pattern, just like regular
tail-call optimisation does.
Without these kinds of optimisations programming in Mercury would hardly
be feasible, and it would be impossible to write loops that used
constant-space. That's why I think they should be enabled by default,
and only disabled when testing the compiler: they are not really
optimisations, but essential features that make the language workable.
Cheers,
Michael
--
Prince: Print with CSS!
http://www.princexml.com
More information about the users
mailing list