hoodwink.d enhanced


Syndey, the New People's Choice Ruby #

by why in inspect

Evan Webb has done this neat thing where he’s branched Ruby 1.8 to add a pile of features that have been tinkling in our ears for years. Look at this list and tell me you haven’t personally tugged on Matz’ apron for this stuff.

  1. Native OS Threads (Thread::OS). These do not replace the normal Threads, and allow for MxN thread setups (see test/sydney/test_osthread.rb#test_mxn).
  2. Backtrace and Frame objects. Exceptions now provide a programmatic way of inspecting the backtrace and relevant frames.
  3. Global Error Handler. A closure which can handle any errors which reach the top (think better IDE integration). [Ed. Note: I was just wishing for this today.]
  4. Native Binding.of_caller
  5. Frame metadata Allows you to attach any data to a frame object which can then be retrieved a number of ways (Kernel.caller, Exception#backtrace, etc)
  6. More event hooks.
    1. GC.on_gc. Run when the garbage collection is about to run. (test_gc.rb)
    2. Ruby::State#on_switch. Run when a new Thread is about to be switched to (test_state.rb)
  7. Fulfillment of RCR 279, user defined % expansion.(test_precexpansion.rb)

Stupendous work. What a great way to try these features out to get an idea of how these changes affect the performance of the interpreter.

I’m compiling on FreeBSD and ./configure --enable-pthread was the right course. Bleeding edge, dangerous stuff, and all that . The release announcement is on Evan’s blog. First development release available as a tarball.

said on 12 Jul 2005 at 14:15

The door is now open… The fork is now here…

Actually, I hope that some of this makes it back into the main Ruby branch. Especially the native threads part. Todo that he had to: All globals have been cleaned up and moved into a unified ruby_state struct (accessable directly in the form of Ruby::State objects).

This would be a very good thing to make it into the ‘official’ Ruby codebase.

said on 12 Jul 2005 at 15:07

Awesome :-)

said on 12 Jul 2005 at 15:32

These features sound great, I don’t think I’d use it, but it’s interesting from a academic perspective. I’m especially interested in the frame extensions… I think you could do much better error reporting with them. Maybe I just haven’t explored enough though.

said on 12 Jul 2005 at 16:09

I’d definitely use these features if they were merged with the standard Ruby.

e.g. currently, Ruby doesn’t play nicely with C libraries that use multiple system threads – both when using the library as an extension, and when Ruby is embedded in another system.

said on 13 Jul 2005 at 01:48

Now we just need to stuff Evan, ko1, and some code monsters like nobu into one room and we’d get rite out of the door this summer :)

Oh and let me highlight one great thing: it compiles with -W* flags. I love to see C compiler warnings enabled in my compilation.

said on 13 Jul 2005 at 03:02

wow, wow and again wow ;-)

said on 13 Jul 2005 at 08:03

Awesome. Number three would probably also be useful in a library for small web scripts.

Comments are closed for this entry.