I'm trying to compile Objective Caml 1.03 (http://pauillac.inria.fr/ocaml)
for my BeBox, under BeOS DR8.2 and Metrowerks CodeWarrior DR2.1. Since
Be's POSIX compatibility is reasonably complete, I was able to get the
byte-code compiler and interpreter running with no more than a few guesses
at the configuration. And that's just the thing that confuses me: The
installation notes state that OCaml requires a stack size of 2 MB or more
to run. BeOS currently imposes a stack limit of 64K per thread (in order
to allow threads in a team to share address space; it's under discussion
right now). So why does it work? Is the Metrowerks compiler using a very
different allocation strategy than gcc does under Unices? Is this somehow
magically not a problem? Or have I not run into the 64K barrier yet,
despite the install notes' warning to the contrary? OCaml can recompile
itself, and that seems like a fairly heavy task.
I'm not unhappy that it works -- quite the contrary, I'm deliriously
happy, because with some work to get the libraries all harmonized, OCaml
would be a beautiful environment for the BeBox. But I am quite confused,
and worried that it will turn around and bite me when I'm not looking.
Christopher Jeris c-j...@uchicago.edu University of Chicago Math!
64k seems a bit small, but 128k is certainly enough for building and
boostrapping the bytecode-based version, because the ML stack is
allocated from the C heap by the virtual machine. The 2M figure is
for the native code version, which uses the OS stack for recursion.
-- Damien