The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
RubyCocoa news

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Laurent Sansonetti

Posts: 134
Nickname: lrz
Registered: Jun, 2006

Laurent Sansonetti is a software engineer at Apple Computer and a longtime Ruby enthusiast.
RubyCocoa news Posted: Oct 2, 2007 9:24 PM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Laurent Sansonetti.
Original Post: RubyCocoa news
Feed Title: lrz's diary
Feed URL: http://www.chopine.be/lrz/diary/xml/rss/feed.xml
Feed Description: lrz's diary
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Laurent Sansonetti
Latest Posts From lrz's diary

Advertisement

Here are some recent news about RubyCocoa. Since I didn't write about this for a long time, this entry is a bit long, sorry.

I mentionned a few months ago threading issues that were fixed. But these were not the only problems. As you may know, threads in Ruby are not native, but emulated. This causes several issues when mixing calls to Foundation within threads, because Foundation expects to have its list of autorelease pools and exception handlers per native thread. When a Ruby thread switching occurs, some very bad problems can therefore appear.

The solution, in the meantime Ruby still uses emulated threads, is to manually save and restore the critical bits when Ruby threads are switched in or out. This unfortunately requires patching the Ruby interpreter, in order to insert hooks where RubyCocoa can plug itself. However, the MacPorts version of Ruby will be by default patched, and we will also provide a binary installer for Tiger that ships with a modified version of libruby.

Informal protocol methods used to be handled by using the dynamic dispatch functionality of NSObject, forwardInvocation:, mostly for historical reasons. Now that we have the list of informal protocol method signatures in the bridge support files, RubyCocoa automatically register the Ruby methods in the Objective-C runtime. This results in faster informal protocol methods calls, but to be honest, I changed that because WebKit 3.0 doesn't seem to appreciate NSProxy-based delegates, and crashes when calling the methods. I still don't know why, but I will investigate.

Last but not least. I added a convenience facility to call predicate Objective-C methods from Ruby, which typically starts with a is prefix in the Cocoa APIs.

   NSBundle.mainBundle.loaded?

# This is the same as: NSBundle.mainBundle.isLoaded

I profited of this change to implement the automatic definition of Ruby predicate proxy methods, which hasn't been done before due to lack of time. Now all Ruby methods are defined after the first pass in method_missing.

We are going to release 0.12.0 very soon with these changes, plus of course many more interesting changes and fixes that were not described here. Actually 0.12.0 should have been released 2 weeks ago :-(

Read: RubyCocoa news

Topic: Is it better than TextMate? (Ruby IDE redux) Previous Topic   Next Topic Topic: Andrew Coyne: Why conservatives should support proportional representation

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use