I would like to load dll and create complex c datatype structure for the
dll. This can be done with ctypes library in Python.
So, do ruby has similar library like ctypes?
···
--
Posted via http://www.ruby-forum.com/.
I would like to load dll and create complex c datatype structure for the
dll. This can be done with ctypes library in Python.
So, do ruby has similar library like ctypes?
--
Posted via http://www.ruby-forum.com/.
Shin guey Wong wrote:
I would like to load dll and create complex c datatype structure for the
dll. This can be done with ctypes library in Python.
So, do ruby has similar library like ctypes?
On Rubinius and JRuby, you can use FFI. I'm hoping someone can do an FFI port for MRI so everyone can start using the same library.
Here's a couple articles on FFI. JRuby and Rubinius support roughly the same API, though it's probably going to see one or two more changes before we release it in JRuby 1.1.4.
http://wiki.jruby.org/wiki/Calling_C_from_JRuby
There also exists the "dl" library on Ruby, but most people I've talked to consider it to be a bit too buggy/leaky for use. I don't know if that's true.
- Charlie
Ruby/DLhttp://ttsky.net/ruby/ruby-dl.html
Doc is a bit scarce, I've had better luck reading source, but it generally
does the job.
On Wed, Aug 13, 2008 at 9:57 PM, Shin guey Wong <sgwong513@hotmail.com>wrote:
I would like to load dll and create complex c datatype structure for the
dll. This can be done with ctypes library in Python.
So, do ruby has similar library like ctypes?
--
Posted via http://www.ruby-forum.com/\.
Charles Oliver Nutter wrote:
On Rubinius and JRuby, you can use FFI. I'm hoping someone can do an FFI
port for MRI so everyone can start using the same library.- Charlie
Is the FFI for Rubinius and JRuby compatible? It would be great is all 3
ruby implementation using the same library.
--
Posted via http://www.ruby-forum.com/\.
On Rubinius and JRuby, you can use FFI. I'm hoping someone can do an FFI
port for MRI so everyone can start using the same library.
In the meanwhile you could try http://www.dyncall.org/\. Seems pretty
functional, could it even be the basis for a MRI FFI?
Greets
--
Posted via http://www.ruby-forum.com/\.
Shin guey Wong wrote:
Charles Oliver Nutter wrote:
On Rubinius and JRuby, you can use FFI. I'm hoping someone can do an FFI
port for MRI so everyone can start using the same library.- Charlie
Is the FFI for Rubinius and JRuby compatible? It would be great is all 3 ruby implementation using the same library.
It is compatible between JRuby and Rubinius, and will be in a production release of JRuby this month (1.1.4). We're looking for help getting an FFI for the C Ruby implementations as well so everyone can use the same library.
- Charlie
Until a uniform solution is done, you can give a try to
http://www.dyncall.org/, it has ruby bindings.
Greets!
On Thu, Aug 14, 2008 at 7:02 PM, Charles Oliver Nutter <charles.nutter@sun.com> wrote:
Shin guey Wong wrote:
Charles Oliver Nutter wrote:
On Rubinius and JRuby, you can use FFI. I'm hoping someone can do an FFI
port for MRI so everyone can start using the same library.- Charlie
Is the FFI for Rubinius and JRuby compatible? It would be great is all 3
ruby implementation using the same library.It is compatible between JRuby and Rubinius, and will be in a production
release of JRuby this month (1.1.4). We're looking for help getting an FFI
for the C Ruby implementations as well so everyone can use the same library.- Charlie
--
Emmanuel Oga
ELC Technologies (TM)
1921 State Street
Santa Barbara, CA 93101
eoga@elctech.com
(866)863-7365 Tel
(866)893-1902 Fax
+44 (0) 20 7504 1346 Tel - London Office
+44 (0) 20 7504 1347 Fax - London Office