Syndey, the New People's Choice Ruby #
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.
- 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).
- Backtrace and Frame objects. Exceptions now provide a programmatic way of inspecting the backtrace and relevant frames.
- 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.]
- Native Binding.of_caller
- 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)
- More event hooks.
- GC.on_gc. Run when the garbage collection is about to run. (test_gc.rb)
- Ruby::State#on_switch. Run when a new Thread is about to be switched to (test_state.rb)
- 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.
Phil
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.
timsuth
Awesome :-)
netghost
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.
timsuth
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.
riffraff
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.
gmosx
wow, wow and again wow ;-)
Qerub
Awesome. Number three would probably also be useful in a library for small web scripts.
Comments are closed for this entry.