[MacRuby-devel] Embedding MacRuby

Rakoth Lichlord rakoth.lichlord at gmail.com
Tue Aug 19 07:21:25 PDT 2008


While writing portions of mac programs in Ruby and mixing it with
Objective-C is cool, but it's not all that MacRuby could do.

I'm attempting to write an application which would contain scriptable
parts, utilizing MacRuby (Lua has been used for this purpose for a
long time, but MacRuby with access to ObjC classes is a much more
powerful tool for the job!).

So far I've run into these issues, any help appreciated:

- Need to execute MacRuby code from any source (parse a string)
Solution 1: "rb_eval_string" - does not cut it because of a bug (#109
in trac) - it seems MacRuby forgets variables created by previous
calls to rb_eval_string, maybe there's more to it then that
Solution 2: [RBKernel eval:@"..."] - This example has been mentioned
in this mailist but I've found no references to RBKernel or anything
similar in the MacRuby.framework. Guess it was more of a proposal.

- Need to be able to clean up (full reset) of the MacRuby VM - release
all defined objects, undefine classes.
Is this even possible? How costly would it be, time-wise?


Yuriy Makhin


More information about the MacRuby-devel mailing list