On Fri, Jul 11, 2014 at 10:57:24AM +0200, Armin Rigo wrote:

Hello Armin,

> A comment about this, if I can make it here: for languages like Python,
> there are two slightly different issues.  The first is to use a constant
> amount of memory to do unbounded calls.  This is difficult because of the
> stack trace issue you mention.  However, a second and smaller issue would
> be to use a constant amount of *stack*, allowing a non-constant amount of
> *heap* to be used.

Yes, that's a good point. My guess is that it won't keep the "we want tail
calls optimised" folk happy. Because it uses arbitrary amounts of memory, it
will be slower than stack-constant tail calls (if my experience with the old
Converge VM is anything to go by). Assuming this would come with "turn the
recursion limit off", it would also mean that anyone who writes an infinitely
recursive function will probably hit death-by-swap before they've noticed ;)

Given that, by typing "unlimit -s" I can allocate a 32MiB stack to processes,
which gives a lot of room for Python-level recursion, I don't honestly know
if allowing people to go much deeper will be much practical help. It won't
hurt, of course (except for the death-by-swap thing).


Laurie
_______________________________________________
pypy-dev mailing list
pypy-dev@python.org
https://mail.python.org/mailman/listinfo/pypy-dev

Reply via email to