# Embedding several ruby interpreter instances in C?

**URL:** <https://www.ruby-forum.com/t/embedding-several-ruby-interpreter-instances-in-c/194658>\
**Category:** Ruby\
**Created:** [September 8, 2010, 4:40pm UTC](https://www.ruby-forum.com/t/embedding-several-ruby-interpreter-instances-in-c/194658 "2010-09-08T16:40:54Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eric\_MSP\_Veith](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/ecd19e/32.png) [@Eric\_MSP\_Veith](https://www.ruby-forum.com/u/Eric_MSP_Veith)\
**Post date:** [September 8, 2010, 4:40pm UTC](https://www.ruby-forum.com/t/embedding-several-ruby-interpreter-instances-in-c/194658/1 "2010-09-08T16:40:54Z")

</div>

-----BEGIN PGP SIGNED MESSAGE-----  
Hash: SHA1

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

```

-----BEGIN PGP SIGNATURE-----  
Version: GnuPG v1.4.9 (GNU/Linux)

iEUEARECAAYFAkyHnuMACgkQhS0drJ3goJJ/cgCVGzuL/A4Gl5kNLQW7/fJMdfL0  
CQCfStrIS2GnJftLMb4ZYcB/PgmhtUM=  
=MQbR  
-----END PGP SIGNATURE-----

---

<div class="post-metadata">

**Author:** ![Eric\_MSP\_Veith](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/ecd19e/32.png) [@Eric\_MSP\_Veith](https://www.ruby-forum.com/u/Eric_MSP_Veith)\
**Post date:** [September 8, 2010, 4:59pm UTC](https://www.ruby-forum.com/t/embedding-several-ruby-interpreter-instances-in-c/194658/2 "2010-09-08T16:59:38Z")

</div>

Hi,

In message “Re: Embedding several ruby interpreter instances in C?”  
on Wed, 8 Sep 2010 23:35:37 +0900, Eric MSP Veith  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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.

```

---

<div class="post-metadata">

**Author:** ![Eric\_MSP\_Veith](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/ecd19e/32.png) [@Eric\_MSP\_Veith](https://www.ruby-forum.com/u/Eric_MSP_Veith)\
**Post date:** [September 8, 2010, 5:11pm UTC](https://www.ruby-forum.com/t/embedding-several-ruby-interpreter-instances-in-c/194658/3 "2010-09-08T17:11:56Z")

</div>

-----BEGIN PGP SIGNED MESSAGE-----  
Hash: SHA1

Hello,

On Wednesday 08 September 2010, Yukihiro M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Yes. We haven’t removed all global variables yet.

Thank you! I just needed the confirmation. 🙂

```
  Eric

```

-----BEGIN PGP SIGNATURE-----  
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkyHp6EACgkQhS0drJ3goJJnAwCfTcRC1p/dgBDQ5FQfvUT3JtDf  
rSgAn3Zb4eYiOxAusW9JFvgckqXemPN4  
=8YVr  
-----END PGP SIGNATURE-----

---

<div class="post-metadata">

**Author:** ![Eric\_MSP\_Veith](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/ecd19e/32.png) [@Eric\_MSP\_Veith](https://www.ruby-forum.com/u/Eric_MSP_Veith)\
**Post date:** [September 8, 2010, 11:05pm UTC](https://www.ruby-forum.com/t/embedding-several-ruby-interpreter-instances-in-c/194658/4 "2010-09-08T23:05:36Z")

</div>

On Sep 8, 2010, at 07:59 , Yukihiro M. wrote:

> |TIA!
> 
> Yes. We haven’t removed all global variables yet.

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

---

<div class="post-metadata">

**Author:** ![Eric\_MSP\_Veith](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/ecd19e/32.png) [@Eric\_MSP\_Veith](https://www.ruby-forum.com/u/Eric_MSP_Veith)\
**Post date:** [September 9, 2010, 3:50am UTC](https://www.ruby-forum.com/t/embedding-several-ruby-interpreter-instances-in-c/194658/5 "2010-09-09T03:50:38Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Eric\_MSP\_Veith](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/ecd19e/32.png) [@Eric\_MSP\_Veith](https://www.ruby-forum.com/u/Eric_MSP_Veith)\
**Post date:** [September 8, 2010, 11:23pm UTC](https://www.ruby-forum.com/t/embedding-several-ruby-interpreter-instances-in-c/194658/6 "2010-09-08T23:23:45Z")

</div>

On Wed, Sep 8, 2010 at 3:05 PM, Ryan D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Didn’t Evan P. do this and provide a patch to ruby-core back in the  
> day (pre-sydney)?

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.”
