[Ironruby-core] IronRuby FFI

Tomas Matousek Tomas.Matousek at microsoft.com
Fri Aug 20 17:57:20 EDT 2010


I would also recommend to look at Python's c-types and especially IronPython's implementation:

http://github.com/ironruby/ironruby/tree/master/Languages/IronPython/IronPython.Modules/_ctypes/

Many of the features might be similar to Ruby's FFI and it would be good to share the implementation with IronPython when possible.

Tomas

From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Charles Strahan
Sent: Friday, August 20, 2010 2:35 PM
To: ironruby-core at rubyforge.org
Subject: Re: [Ironruby-core] IronRuby FFI

That's something I'm curious about too. I don't know whether or not P/Invoke alone can match the functionality of libffi. I'd have to look through some of libffi and see if there's anything can't be accomplished in C#.

If everything can be accomplished in C#, I'd go that route. We could emit types at runtime that have the necessary DLLImport attributes and such (something I've already done for little projects of mine).

-Charles
On Fri, Aug 20, 2010 at 4:14 PM, Will Green <will at hotgazpacho.org<mailto:will at hotgazpacho.org>> wrote:
Couldn't this be implemented via P/Invoke? Would P/Invoke work without the attributes required in C#?

--
Will Green
http://hotgazpacho.org/

On Fri, Aug 20, 2010 at 4:49 PM, Charles Strahan <charles.c.strahan at gmail.com<mailto:charles.c.strahan at gmail.com>> wrote:
Ryan,

I'm right there with you, only I looked at JFFI for inspiration (didn't know mono had anything - could you share more about that?). In fact, In my infinite laziness, I posted a job for a couple hundred bucks on Rent-A-Coder, hoping someone could essentially port JFFI to C#, so I could focus on writing the actually IronRuby library... but nothing came of that.

I'm tempted to suck it up and start coding this myself. Would you be interested in working together?  I figured I'd take the approach of essentially writing "NFFI", and then write an IronRuby lib around that.

-Charles

On Fri, Aug 20, 2010 at 2:33 PM, Ryan Riley <ryan.riley at panesofglass.org<mailto:ryan.riley at panesofglass.org>> wrote:
I know that we've discussed this in the past, but I'm interested in doing it for two reasons:
1. We use mono with a bridge to ObjectiveC and Cocoa, and we'd like to investigate libffi via mono as a potential replacement for our current bridge.
2. I'm interested just for the sake of learning more about FFI.

Mono appears to have had a libffi implementation that was later removed, so I think I have a place to start. However, I'm not sure that's the right starting point. Does anyone have a suggestion for how to get started? I've been taking a look at libffi and DllImport, but I'm not sure if those are the right directions, something else, or what.

Thanks,

Ryan Riley

Email: ryan.riley at panesofglass.org<mailto:ryan.riley at panesofglass.org>
LinkedIn: http://www.linkedin.com/in/ryanriley
Twitter: @panesofglass
Blog: http://wizardsofsmart.net/
Website: http://panesofglass.org/
_______________________________________________
Ironruby-core mailing list
Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org>
http://rubyforge.org/mailman/listinfo/ironruby-core


_______________________________________________
Ironruby-core mailing list
Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org>
http://rubyforge.org/mailman/listinfo/ironruby-core


_______________________________________________
Ironruby-core mailing list
Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org>
http://rubyforge.org/mailman/listinfo/ironruby-core

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100820/68bb9a33/attachment.html>


More information about the Ironruby-core mailing list