From: Michael DeHaan Date: 2004-10-28T21:51:43+09:00 Subject: Re: Ruby/DL (was Re: The real Ruby vs. Python.) Speaking of Ruby/DL, I have a question ... Supposing I have a library that demands control of an event loop. Examples could include GLUT (glutMainLoop) or SDL, but maybe it's something else. What ways are there in Ruby/DL to call back into Ruby code from the C library? Is this even possible, or do I have to write Swig/XS for this? Up until this point I haven't had a need for XS/Swig, so I've typically gone the Ruby/DL route (in what few Ruby apps I've written), or I've used Inline::C (awesome module, BTW) in Perl. Anyhow, ruby-sdl and ruby-opengl may exist, but occasionally I take some pleasure in reinventing wheels...or at least in knowing how to. In fact, ruby-opengl might be a good example after all. I'd really like to stay down in C code for longer lengths of time, so this is a case where writing one's own bindings may be useful. --Michael DeHaan On Thu, 28 Oct 2004 07:49:01 +0900, gabriele renzi wrote: > Jamis Buck ha scritto: > > > > Besides which: Ruby/DL is often touted as a great way to write extension > > libraries. Are there any examples of libraries that have been written > > using Ruby/DL instead of C? I've never seen any, much to my own > > frustration when I would like a good example of Ruby/DL usage. :( > > > > well I can only remember the htmltidy library, never looked at it, anyway :/ > >