* William Djaja Tjokroaminata (billtj / y.glue.umd.edu) wrote: > Hi Phil, > > I just want to say, that writing a C extension in Ruby is simply another > world beyond Ruby and C. Even if someone is a really great Ruby > programmer and a really great C programmer, he still needs to learn how to > write a C extension in Ruby. (Especially, writing C in the presence of a > garbage collector can be tricky if the data structure is overly complex.) > > Currently not much documentation exists, and if you just scanned the > previous discussions in this newsgroup you may find several things that > are useful. The file README.EXT (distributed with Ruby) and the Extending Ruby section of the Pickaxe book are both excellent sources of information. I believe the Ruby Developer's Guide includes a brief section on writing bindings as well. > Finally, if you write C by just translating the Ruby code to a C code, you > may want to look at rb2c > (http://easter.kuee.kyoto-u.ac.jp/~hiwada/ruby/rb2c/), > which hopefully can do the job automatically for you (I haven't tried it > myself). Then only if you want to highly optimize your code, you can > start writing the C extension by hand. > > Regards, > > Bill > ========================================================================== > Philip Bacon <philip.bacon / nextpage.com> wrote: > > I am writing a C extension and wish to call a block from within one of > > my extension's methods. -- Paul Duncan <pabs / pablotron.org> pabs in #gah (OPN IRC) http://www.pablotron.org/ OpenPGP Key ID: 0x82C29562