Embedding several ruby interpreter instances in C?

Hello list,

the subject says it all: I know how to generally embed Ruby into a C
program. However, since ruby_init() & co just return void, I guess there is
no way to have more than one Ruby interpreter embedded into the same program
at a given time. Am I correct with this assumption?

TIA!

      Eric

Hi,

···

In message "Re: Embedding several ruby interpreter instances in C?" on Wed, 8 Sep 2010 23:35:37 +0900, Eric MSP Veith <eveith@wwweb-library.net> writes:

the subject says it all: I know how to generally embed Ruby into a C
program. However, since ruby_init() & co just return void, I guess there is
no way to have more than one Ruby interpreter embedded into the same program
at a given time. Am I correct with this assumption?

TIA!

Yes. We haven't removed all global variables yet.

              matz.

Eric MSP Veith wrote:

the subject says it all: I know how to generally embed Ruby into a C
program. However, since ruby_init() & co just return void, I guess there is
no way to have more than one Ruby interpreter embedded into the same program
at a given time. Am I correct with this assumption?

This is a specific goal of Rubinius, and I know that it *did* work
with the old stackless Shotgun VM. I'm not sure about the current VM,
but if it doesn't work, it's probably a bug that will be fixed.

jwm

Hello,

···

On Wednesday 08 September 2010, Yukihiro Matsumoto <matz@ruby-lang.org> wrote:

Yes. We haven't removed all global variables yet.

Thank you! I just needed the confirmation. :slight_smile:

      Eric

Didn't Evan Phoenix do this and provide a patch to ruby-core back in the day (pre-sydney)?

···

On Sep 8, 2010, at 07:59 , Yukihiro Matsumoto wrote:

Hi,

In message "Re: Embedding several ruby interpreter instances in C?" > on Wed, 8 Sep 2010 23:35:37 +0900, Eric MSP Veith <eveith@wwweb-library.net> writes:

>the subject says it all: I know how to generally embed Ruby into a C
>program. However, since ruby_init() & co just return void, I guess there is
>no way to have more than one Ruby interpreter embedded into the same program
>at a given time. Am I correct with this assumption?
>
>TIA!

Yes. We haven't removed all global variables yet.

Via my magical copypasta IRC to ruby-talk gateway, Evan says:

"yes, my patch removed all global variables (it was in syndey). no, it's
not applicable to 1.9."

···

On Wed, Sep 8, 2010 at 3:05 PM, Ryan Davis <ryand-ruby@zenspider.com> wrote:

Didn't Evan Phoenix do this and provide a patch to ruby-core back in the
day (pre-sydney)?

--
Tony Arcieri
Medioh! A Kudelski Brand