[MacRuby-devel] [MacRuby] #219: Feature: ObjC <=> Ruby Proxy interface
MacRuby
ruby-noreply at macosforge.org
Tue Feb 3 14:29:58 PST 2009
#219: Feature: ObjC <=> Ruby Proxy interface
-----------------------------------------+----------------------------------
Reporter: ash@… | Owner: lsansonetti@…
Type: enhancement | Status: new
Priority: blocker | Milestone:
Component: MacRuby | Keywords:
-----------------------------------------+----------------------------------
Working with MacRuby is nice, but I saw an interesting feature of another
ruby project called Johnson. Its a javascript bridge for ruby, it
literally ties Spidermonkey into the Ruby runtime and lets you do
everything from run and parse html DOM and pass objects between Ruby's
runtime and Javascripts runtime. My point is they have a proxy class that
gives one the ability to pass objects between the environments.
This kind of feature might be useful for MacRuby, if I could define my
ruby class in ruby then pass it to an Objective C proxy then have an
Objective C class call it, it would be kind of nice.
Here is Johnson: http://github.com/jbarnette/johnson/tree/master
and here is a presentation that talks about some of the things I am
talking about: http://rubyconf2008.confreaks.com/how-i-learned-to-love-
javascript.html
they use Johnson to make a ruby object and pass it to javascript and vise-
versa.
I am not an Objective C expert so there might be something in Objective C
that might prevent this but if you can dynamically create a class that's
function calls just bounce from an Objective C caller to a proxy to their
Ruby implementation and I know you can do the opposite in ruby.
This might be unnecessary or not needed for MacRuby, but I could see this
being very useful for prototyping things, plus if you could proxy other
Objective C classes into ruby without much work.
--
Ticket URL: <http://www.macruby.org/trac/ticket/219>
MacRuby <http://macruby.org/>
More information about the MacRuby-devel
mailing list