Forum: IronRuby Fwd: Ruby FFI port

D2a71671c69e5bbc715d7979d69214ec?d=identicon&s=25 Charles Strahan (charles-strahan)
on 2011-03-28 01:46
(Received via mailing list)
Well, I think I've made a little progress - hoping to attach a simple
function soon.

I am concerned about one thing though - we need to be able to call
function
pointers, but I think that *Marshal.GetDelegateForFunctionPointer* only
supports the STD calling convention. Any thoughts on how we might
support
cdecl?  Presently, it's not a blocking concern - so I'll cross that
bridge
when the time comes...


Wayne: Sorry - I meant to send that to the mailing list, as opposed to
sending it directly to you.

-Charles
D2a71671c69e5bbc715d7979d69214ec?d=identicon&s=25 Charles Strahan (charles-strahan)
on 2011-03-31 12:02
(Received via mailing list)
Well, with some really, *really *ugly hacking, I've managed to get this
far
(the first example from FFI wiki):

irb(main):011:0> module Hello
irb(main):012:1>   extend FFI::Library
irb(main):013:1>   ffi_lib FFI::Library::LIBC
irb(main):014:1>   attach_function 'puts', [ :string ], :int
irb(main):015:1> end
*(Object doesn't support #inspect)*
=>
irb(main):016:0> Hello.puts("Hello, World")
Hello, World
=> 0

(dunno why that *"(Object doesn't support #inspect)"* shows up...)

Anywho, I think we might might have a significant portion of FFI
implemented
fairly soon.  The codebase is still pretty unstable/crappy, but I'm
hoping
to get it ready for contributions soon.

-Charles



On Sun, Mar 27, 2011 at 6:28 PM, Charles Strahan <
D2a71671c69e5bbc715d7979d69214ec?d=identicon&s=25 Charles Strahan (charles-strahan)
on 2011-03-31 12:06
(Received via mailing list)
> I am concerned about one thing though - we need to be able to call function
> pointers, but I think that *Marshal.GetDelegateForFunctionPointer* only
> supports the STD calling convention. Any thoughts on how we might support
> cdecl?  Presently, it's not a blocking concern - so I'll cross that bridge
> when the time comes...


D'oh! I overlooked the
UnmanagedFunctionPointerAttribute<http://msdn.microsoft.com/en-us/library/system.run...
.

-Charles

On Thu, Mar 31, 2011 at 4:41 AM, Charles Strahan <
99b1f0c67bec23747d007e27d000487b?d=identicon&s=25 Ryan Riley (Guest)
on 2011-03-31 15:51
(Received via mailing list)
Are you coming to ALT.NET Seattle? We have an OSS track this year to
help people learn how to contribute to projects. Interested?

Ryan

Sent from my iPhone
D2a71671c69e5bbc715d7979d69214ec?d=identicon&s=25 Charles Strahan (charles-strahan)
on 2011-04-01 02:21
(Received via mailing list)
Ryan,

I'm *absolutely* interested, but, as much as it shames me to say, the
ALT.NET Seattle conference wasn't on my radar until just now.

I'm down for next year though, especially if you plan to give an F#
workshop.

-Charles
D2a71671c69e5bbc715d7979d69214ec?d=identicon&s=25 Charles Strahan (charles-strahan)
on 2011-04-04 13:46
(Received via mailing list)
All,

IronRuby FFI is coming along well.  So far, I support most of the
FFI::Function uses, including attaching to function pointers, library
functions, and wrapping Procs.

Structs are at 50%, and callbacks need to be implemented.

I'll need just another week or two to cut the first release.

-Charles


On Thu, Mar 31, 2011 at 5:00 AM, Charles Strahan <
Bec38d63650c8912b6ba9b557fb953b9?d=identicon&s=25 Roger Pack (rogerdpack)
on 2011-04-14 22:29
> I'll need just another week or two to cut the first release.

Maybe it can merge with mainline ffi gem at some point?
-r
D2a71671c69e5bbc715d7979d69214ec?d=identicon&s=25 Charles Strahan (charles-strahan)
on 2011-04-24 02:21
(Received via mailing list)
That's a possibility, but it might have to come further down the road.

-Charles
F2b0fa610fe8335d4203b8c2eab59dbc?d=identicon&s=25 James Leskovar (jamesleskovar)
on 2011-06-04 11:31
I just wanted to check how the Ruby FFI library was coming along?
This topic is locked and can not be replied to.