[MacRuby-devel] question about goals for ruby module compatibility with macruby

Jeremy Voorhis jvoorhis at gmail.com
Thu Jul 30 10:33:54 PDT 2009


If MacRuby is aiming for full FFI support, a la JRuby, then creating
interpreter-independent versions of C extensions need not be difficult. I've
begun porting some of my own Ruby bindings from DL and C and have found that
as long as you handle your C types correctly, everything tends to Just Work
on MRI versions 1.8.6, 1.9.1, and recent versions of JRuby.
To my knowledge, the macruby-experimental branch only supports attaching C
functions (e.g. no structs, callbacks), but that is likely to improve. The
FFI documentation is also a little thin, but it's easy to pick up once
you've seen some examples. Here's a CoreMIDI driver I've ported to FFI:
http://github.com/jvoorhis/midiator/blob/4e6024b8e68503868272770d8c8ecabe02445f85/lib/midiator/drivers/core_midi.rb

Best,

Jeremy

On Thu, Jul 30, 2009 at 10:09 AM, Matt Aimonetti <mattaimonetti at gmail.com>wrote:

> Hi Tim,
>
> I was about to reply to your colleague, Mr Otero, so let me try to clarify
> a few things that might help others.
>  The goal for MacRuby 0.5 is to be able to run any rubygems that are not C
> extensions. ( see Macruby 0.5 roadmap:
> http://lists.macosforge.org/pipermail/macruby-devel/2009-July/002091.html)
>
> The good news is that the BioRuby gem is pure Ruby, the bad news is that
> it's not fully compatible with Ruby 1.9 yet. (MacRuby is aiming for Ruby 1.9
> compatibility) However, that shouldn't be hard to fix.
>
> Regarding Rails, that's a different story, as you probably know, Rails 3 is
> going to be released towards the end of the year. Rails is a big project and
> quite a challenging one to have running on top of any Ruby implementation.
> The primarily goal of MacRuby is to let people write Cocoa apps in Ruby, so
> Rails is not at the top of the todo list.
> However, this is something we would really like to be able to do ASAP.
> (being part of the Rails team, I would love to see that happen).
>
> Rails also uses some C based extensions like its DB drivers and we would
> need to find workarounds.
>
> I hope it helps,
>
> - Matt
>
>
>
> On Thu, Jul 30, 2009 at 9:36 AM, Tim Rand <timrandg at gmail.com> wrote:
>
>> Hi Laurent and macruby-ists,I am thinking about taking on a rather
>> ambitious project with macruby in the next year or so which would benefit
>> from having access to existing ruby gems (like the bioruby gem and rails).
>> Can anyone predict how general the ruby gem compatibility will be as macruby
>> matures? I promise I won't hold anyone responsible for their speculation.
>> Tim
>>
>>
>> _______________________________________________
>> MacRuby-devel mailing list
>> MacRuby-devel at lists.macosforge.org
>> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>>
>>
>
> _______________________________________________
> MacRuby-devel mailing list
> MacRuby-devel at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-devel/attachments/20090730/b735b1ee/attachment.html>


More information about the MacRuby-devel mailing list