On Thu, Apr 27, 2017 at 8:13 PM, Justin Zamora <jus...@zamora.com> wrote:
> On Thu, Apr 27, 2017 at 8:06 PM, Jon Zeppieri <zeppi...@gmail.com> wrote:
>>
>> OCaml does handle tail calls properly. But proper tails calls are not
>> the subject of this discussion. The original post was explicitly about
>> non-tail calls and how, in Racket, you cannot exhaust the stack
>> without exhausting all of the memory available to the program.
>> (Whereas in OCaml you can, because it uses a fixed-size stack.)
>
>
> How common is it to have a fixed-size stack? I thought it was normal
> practice for the heap and stack to be on opposite ends of memory and to grow
> towards each other, so that either can use all available memory.
>
> Justin

It's the norm, and it's typically enforced by the OS. (Of course, you
could ignore the system's stack and build your own stack in the heap,
but you will pay a performance price.) That's why the technique that
Matthias described involves detecting overflows and copying the
current stack to the heap.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to