The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
FFI Blues

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Daniel Berger

Posts: 1383
Nickname: djberg96
Registered: Sep, 2004

Daniel Berger is a Ruby Programmer who also dabbles in C and Perl
FFI Blues Posted: Aug 7, 2009 1:16 PM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Daniel Berger.
Original Post: FFI Blues
Feed Title: Testing 1,2,3...
Feed URL: http://djberg96.livejournal.com/data/rss
Feed Description: A blog on Ruby and other stuff.
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Daniel Berger
Latest Posts From Testing 1,2,3...

Advertisement
Lately I've been experimenting with FFI, the wrapper around libffi that let's you write C code without ever leaving pure Ruby. I figured with JRuby already using it, and Rubinius and IronRuby on their way, it might be time to start porting some of my C extensions over.

Unfortunately, I've slammed into the cold hard fact that FFI just isn't the grand solution we all hoped it would be. The first problem is that libffi, the underlying source for C based implementations, isn't going to build without the gcc toolchain. That pretty much leaves everyone but Linux, FreeBSD and OS X in the dust, including two heavy hitters, MS Windows and Solaris (if you're using the Sun Studio compiler). Then there's the issue of JRuby's lack of support for certain parts of C, such as file descriptors, as my attempt to port file-temp demonstrated.

So now I'm in a dilemma. If I want to write cross-platform code that will work with JRuby and C based implementations, I'm relegated to keeping two (or more) separate source files, one for MRI and one for JRuby. It would more likely be 3, as I'll still need a separate source file for Windows, since the code is radically different from its *nix counterpart most of the time.

On top of that I've heard disturbing reports that there is little interest in supporting FFI on Windows, in which case we may as well declare it dead in the water. Whether you like it or not, Windows is a major player and its here to stay. If it's not going to work on Windows you may as well chuck it now and stick with C extensions.

Read: FFI Blues

Topic: My Apprenticeship - Thursday, August 5, 2004 Previous Topic   Next Topic Topic: Firefox Blues

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use