Embedded ruby limitations

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

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?

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

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.