Aria Stewart
7/11/2006 4:50:00 PM
On Wed, 2006-07-12 at 01:45 +0900, vasudevram wrote:
> Hi,
>
> Whats a good way to write a C extension to Ruby?
>
> I'm aware that there's a chapter about in the Pickaxe book (I think),
> and will be checking that out, and also SWIG, if it supports Ruby. But
> looking for replies from anyone who has already tried any of these
> ways, and their feedback.
The Pickaxe chapter is pretty good. Best yet, go to the RAA, grab a
simple extension, and dissect.
Finding living examples of extconf.rb is really good.
Writing C extensions for ruby isn't that hard unless you get hit by GC
problems, where your memory gets claimed, but it's not so hard.
My ruby-epeg module took about 4 hours to write, and is pretty
understandable.
Aria