Newsgroups: rec.arts.int-fiction
Path: news.duke.edu!newsgate.duke.edu!nntp-out.monmouth.com!newspeer.monmouth.com!newscon02.news.prodigy.com!prodigy.com!cpk-news-hub1.bbnplanet.com!news.gtei.net!newsfeed1.cidera.com!Cidera!news-reader.ntrnet.net!uunet!ash.uu.net!world!buzzard
From: buzzard@world.std.com (Sean T Barrett)
Subject: Re: [Glulx] branching to another function...
Message-ID: <GJF7L1.CIp@world.std.com>
Date: Mon, 10 Sep 2001 00:19:49 GMT
References: <e61ef191.0109081452.45f636f9@posting.google.com> <e61ef191.0109082124.15f91f96@posting.google.com> <GJEo84.1n1@world.std.com> <e61ef191.0109091339.4491f88@posting.google.com>
Organization: The World Public Access UNIX, Brookline, MA
Lines: 47
Xref: news.duke.edu rec.arts.int-fiction:92414

Jon Zeppieri <97jaz@my-deja.com> wrote:
>Sean Barrett wrote:
>> Another thing you could do is have them all call the gc
>> and just live with the fact that their live data isn't exposed
>> to the gc--e.g. make sure the place where you're calling the
>> gc doesn't leave any surprising data hanging.
>
>I'm not sure I understand this.  If you mean:  when GC occurs, "make
>sure the entirety of the root set is located somewhere other than the
>stack (i.e. the stack will contain only immediate values and pointers
>to values that are reachable by other means)," then I'm not sure how
>to ensure that.

Well, ignoring your example because I don't know how your example
maps down to compiled code, I was just interpreting "allocation
routine" as literally "allocation routine" in any imperative language--
a routine that does nothing other than allocate a little bit of memory
(it does not, say, initialize itself). Such an allocation routine
can't have pointers to any interesting things--they'll all end up
in another function which one presumes ends up as a continuation
somewhere.

If what you're calling "an allocation function" is actually a function
that from say a C perspective would look more like

    Cell *cons(void *car, void *cdr)
    {
       // allocate some memory and initialize it to hold car and cdr
    }

then yeah, you're correct, and we just had a bit of jargon
confusion over "allocation routine".

>I'm curious about your VM.  Would it be able to host a Scheme
>implementation?

Probably only for an not-very-interesting dialect of Scheme.
It's pretty similar to the Tads 3 VM, except for two things: for
one, that it's more carefully designed to support multiple possible
interpreters and multiple possible source languages--except it imposes
a very specific set of primitive datatypes on any language, and they're
probably not a set that would be of interest for a Scheme-like
language--and for another, there are no actual implemented interpreters.
(Or rather I'm 2/3s done one, about 1/3 done the compiler for it, and
I've put it on hold while I see how Tads 3 turns out.)

SeanB
