[gambit-list] How JS backend GC:s?

Mikael mikael.rcv at gmail.com
Tue May 6 17:46:04 EDT 2014


Ah right, and also, the Scheme stack being an extensible array
allocated contiguously - does the Gambit code have logics that clean it up
as you go along, or is all that done by the JS GC too?

By extensible, do you mean variable-size through use of JS' .push() /
.pop() , or something else?

Best regards, Mikael

 Scheme objects are mapped to JS objects.  So a pair is an instance of the
>> "class" Gambit_Pair, and a vector is an instance of the class
>> Gambit_Vector.  Scheme closures are JS closures.  A Scheme continuation is
>> a chain of frames (each frame is a JS array).  So everything is garbage
>> collectible by the JS GC.
>>
>> There is a bit of fanciness in how the continuations are created.  The
>> Scheme stack is an extensible array and stack frames are allocated in this
>> array contiguously.  When a continuation is captured the stack is emptied
>> and each frame becomes an independent JS array.
>>
>
> Aha. And then, when one stack frame (JS  array) refers to another stack
> frame (JS array), then this is done by the means of an actual object
> reference?
>
> E.g.
>
> var frame1 = [value, value ...... ];
>
> var frame2 [value, ........ frame1, ...];
>
> ?
>
>>
>> Marc
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20140506/34d7cb57/attachment.htm>


More information about the Gambit-list mailing list