Forum: Ruby embedded ruby limitations

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
4f6a59bfb4961ac00c87061198f4fdd0?d=identicon&s=25 derek (Guest)
on 2005-11-17 20:04
(Received via mailing list)
I really want to embed ruby in a new app.  However, the limitation
of one interpreter per process is too limiting and possibly
dangerous for what i want to do.

Is this limitation being addressed?  I might be willing to wait a
short while if the limitation were to be removed.  However, it looks
like i probably need to go with something like Python or TCL or LUA.
   I'd really prefer ruby but i'm not sure i have that option.

Thanks,
Derek
1d6252c8fa730e6b9989db64df35103a?d=identicon&s=25 J. Merrill (j-merrill)
on 2005-11-18 19:27
derek wrote:
> I really want to embed ruby in a new app.  However, the limitation
> of one interpreter per process is too limiting and possibly
> dangerous for what i want to do. [snip]

What are you expecting (your users?) to do in Ruby that could require
multiple interpreters?  Are you writing a web app using a not-ruby-aware
framework, so you need to have separate "contexts" for different users
of the app?
C6a0688ca96947d3e289143fc7c707c3?d=identicon&s=25 byrd.timothy (Guest)
on 2005-11-18 22:48
(Received via mailing list)
> What are you expecting (your users?) to do in Ruby
> that could require multiple interpreters?  Are you
> writing a web app using a not-ruby-aware framework,
> so you need to have separate "contexts" for different
> users of the app?

(pardon my Windows-centric terminology)

Imagine a command shell that can run individual Ruby commands
maintaining a persistent Ruby environment.  For example (given a syntax
of "%@ruby[" <ruby_statement> "]"):

    %@ruby[b = 42]
    %@ruby[p b]

would print 42 on the console, and then

    %@ruby[`set q=#{b**3}`]

would set the environment variable q to 74088 - *back in the calling
environment*.

Meanwhile, the shell would be able to directly run Ruby scripts, but
might well want to run them in a fresh, clean environment, as is done
by invoking ruby.exe on a script. And after the script has finished,
the b would still be 42 in the command shell's persistent Ruby
environment.

-- Timothy
58479f76374a3ba3c69b9804163f39f4?d=identicon&s=25 drbrain (Guest)
on 2005-11-18 23:09
(Received via mailing list)
On Nov 18, 2005, at 1:47 PM, Timothy Byrd wrote:

> syntax
> environment*.
>
> Meanwhile, the shell would be able to directly run Ruby scripts, but
> might well want to run them in a fresh, clean environment, as is done
> by invoking ruby.exe on a script. And after the script has finished,
> the b would still be 42 in the command shell's persistent Ruby
> environment.

I think irb's workspaces work this way.
This topic is locked and can not be replied to.