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
on 2011-03-28 01:46
on 2011-03-31 12:02
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 <
on 2011-03-31 12:06
> 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 <
on 2011-03-31 15:51
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
on 2011-04-01 02:21
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
on 2011-04-04 13:46
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 <
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
Please log in before posting. Registration is free and takes only a minute.
Existing account
(Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
Log in with Google account | Log in with Yahoo account
No account? Register here.