[ANN] FFI madness! Rubygame 2.6, Ruby-SDL-FFI 0.1, and Nice-FFI 0.2released

J

John Croisant

It's FFI madness! That's foreign function interface, i.e. accessing
compiled C libraries directly from Ruby. I've got three library
releases to announce, all of them filled with FFI awesomeness.

First up is Rubygame 2.6, which throws away the old compiled C
wrapper, instead using FFI to load SDL and related libraries. This is
the easiest to install and most portable version of Rubygame ever,
especially for Windows users. It's also the first version of Rubygame
to run on JRuby in addition to MatzRuby.

Next is Ruby-SDL-FFI 0.1, which provides FFI interfaces to SDL,
SDL_image, SDL_gfx, SDL_mixer, and SDL_ttf. Ruby-SDL-FFI is similar in
scope to the venerable Ruby/SDL library, but is not a drop-in
replacement (the APIs are different, Ruby-SDL-FFI's is more of a
direct mirror of the SDL C interface). Ruby-SDL-FFI is still in an
early formative stage, and hasn't been thoroughly tested, so use with
caution. Like Rubygame 2.6, this library works on both MatzRuby and
JRuby, and any Ruby implementation with a compatible FFI API.

Finally, there is Nice-FFI 0.2, a helper library that makes developing
FFI-based Ruby libraries even more convenient. Some of the nice things
it offers are: easy creation of new struct instances from an array or
hash of values, from a raw byte string, or wrapping an existing
pointer; easy wrapping of struct pointers returned from functions; a
smart memory management system for structs; hidden and read-only
struct members; advanced pathset system for finding and loading
libraries on many platforms; and more! Nice-FFI is more stable and
well-tested than Ruby-SDL-FFI, but it's still in early stages. It
works with both Ruby-FFI and JRuby's FFI.

Install instructions and download links are available at the Rubygame blog:

http://blog.rubygame.org/articles/2009/10/24/rubygame-2-6-released

You can ask questions and get help in the Rubygame forums:

http://rubygame.org/forums/

Enjoy!

- John

P.S. Many thanks to the people working on Ruby-FFI and JRuby for
making it so easy. I can wholeheartedly recommend that any developer
working on a compiled C wrapper should try FFI instead.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top