[plt-scheme] compiler/zo-parse questions

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Thu Apr 15 15:42:58 EDT 2010

You might want to read Casey's master's paper for some of this detail
(there should be a journal paper at some point that expands on this
too). It explains the mzscheme machine in more detail.


On Thu, Apr 15, 2010 at 2:37 PM, Danny Yoo <dyoo at cs.wpi.edu> wrote:
> I'm working on a project involving compiler/zo-parse,
>
>    http://docs.plt-scheme.org/mzc/decompile.html
>
> I'm trying to understand what max-let-depth is used for; it exists
> under the toplevel, module, and lambda forms.  How does the mzscheme
> runtime use this value?

The max-let-depth has to be a number larger than the amount of stack
that the machine needs to push to evaluate that function (or module
body, etc) or else the machine will crash (since it believes the
number). The byte code verifier ensures the number is correct before
running the bytecode.

> There's also a curious note for several of the forms with the
> following structure:
>
>    After <X> is evaluated, the stack is restored to its depth from
> before evaluating <X>.
>
> I don't understand this yet.  I suspect that, under some
> implementations, a frame is pushed onto the stack to make it possible
> to capture the current continuation, and the note is saying what
> requirements are necessary to preserve tail calls.  Is that the way to
> interpret the comment?

Sorry, I'm not sure about this one, but I agree it does sound like
something to do with tail calls.

Robby


Posted on the users mailing list.