[#68478] Looking for MRI projects for Ruby Google Summer of Code 2015 — Tony Arcieri <bascule@...>

Hi ruby-core,

10 messages 2015/03/10

[ruby-core:68514] Re: Seven stacks (and two questions)

From: Nobuyoshi Nakada <nobu@...>
Date: 2015-03-13 04:52:52 UTC
List: ruby-core #68514
On 2015/03/12 22:00, Nobuyoshi Nakada wrote:
> On 2015/03/12 19:15, Jakub Trzebiatowski wrote:
>> The Ruby Hacking Guide says that Ruby has… seven stacks. Is it an
>> implementation choice (and it could be implemented with one stack),
>> or is there really a need for seven logical stacks? For example, Lua
>> has one stack, and still closures with upvalues are totally possible
>> (it’s like Ruby’s blocks that can reference local variables of
>> their enclosing method, but it works for any function with any
>> upvalues).
> 
> RHG is a good book, but quite old for the core implementation.

Perhaps, "stacks" might confuse you, I guess.

They are actually single-linked lists, stored on the machine stack but not separate areas, and called "stacks" as they are used as LIFO.
The reason counting separately is that all infos are not always saved/restored together.

-- 
Nobu Nakada

In This Thread

Prev Next