Is it easy to embed ruby inside an application?
So I want to embed the ruby interpreter inside an existing
application (and not the other way round, provided by ruby extension
mechanism).
For what it’s worth, the application is opensource (GPL-ed), is is the
guis Gtk2 widget server. see
http://starynkevitch.net/Basile/guisdoc.html or
http://freshmeat.net/projects/guis/ for details. Currently Guis is
embedding the Lua interpreter but I might consider changing to Ruby if
embedding it inside Guis is doable. (the C glue between Lua & most of
GTK2 in Guis is machine generated, so I only have to change the
generator, provided embedding ruby inside another code is easily
doable).
Are there opensource application embedding Ruby?
regards
···
–
Basile STARYNKEVITCH http://starynkevitch.net/Basile/
email: basilestarynkevitchnet
alias: basiletunesorg
8, rue de la Faïencerie, 92340 Bourg La Reine, France
Hi,
Is it easy to embed ruby inside an application?
Not hard. But not as easy as Tcl is.
Embedding Ruby has the following restrictions:
- one interpreter per proecss (no interpreter object)
- no interpreter reset
- GC do not work well with native thread
Are there opensource application embedding Ruby?
mod_ruby, JED/Ruby, Vim/Ruby, etc.
matz.
···
In message “embedding ruby inside an application?” on 02/09/23, Basile STARYNKEVITCH <basile+NO@SPAM+starynkevitch.net.invalid> writes:
Are these being addressed in 1.7 or future versions? Or is this by
design?
···
On Wednesday, September 25, 2002, at 12:49 AM, Yukihiro Matsumoto wrote:
Embedding Ruby has the following restrictions:
- one interpreter per proecss (no interpreter object)
- no interpreter reset
- GC do not work well with native thread
Is there anything fundamental preventing someone from taking the 1.7
codebase and trying to make it multi-intrepreter/reset cabable? I’ve
done this sort of thing before for large simulation codebases, and
it’s usually not difficult work (although it may be time-consuming).
Typically, my approach was to first hunt down all the globals and
place them into a “global” data structure -
e.g. RubyInterpGlobals. Then we move the formerly global structure
into non-global space and modify the appropriate functions to accept
the structure as an argument. Again, its not difficult, but it is
large-scale refactoring. You can break up the work somewhat by doing
it on a module by module basis.
···
On Wed, Sep 25, 2002 at 05:28:34PM +0900, Yukihiro Matsumoto wrote:
In message “Re: embedding ruby inside an application?” > on 02/09/25, Ryan Davis ryand-ruby@zenspider.com writes:
Embedding Ruby has the following restrictions:
- one interpreter per proecss (no interpreter object)
- no interpreter reset
- GC do not work well with native thread
Are these being addressed in 1.7 or future versions? Or is this by
design?
For the good news, it is planned to fix these problems in the next
major release, so called Rite (Ruby 2.0).
For the bad news, it still is a vaporware. No fixed date nor roadmap
is revealed.
matz.
–
Alan Chen
Digikata LLC
http://digikata.com