[MacRuby-devel] macruby nightly build 2009-09-10

Jordan Breeding jordan.breeding at me.com
Wed Sep 23 20:16:04 PDT 2009


Sorry, I don't know if I missed something or not.

Currently MacRuby has a GC (as does Ruby) and it is based on Obj-C's  
GC. This means that code pulled in to MacRuby MUST be GC currently.

In my opinion this isn't horrible or extremely difficult as you can  
compile frameworks as -fobjc-gc instead of fobjc-gc-only and make sure  
that you have all of the proper ref-counting in place.

It seems to me that the original problem here was someone sending ref- 
counting messages straight from Ruby code. Where I get confused is  
that then Laurent said "in the future we might introduce a mode where  
MacRuby doesn't use this GC".

I assume that the plan isn't to ditch GC all together in MacRuby since  
Ruby has a GC, so I am assuming that the goal of this possible future  
mode is to have Ruby code be garbage collected but not require Obj-C  
code to be GC anymore.

I am guessing because this is the first I remember seeing about this  
and am curious as to how it would work in practice. At least to me the  
current system of making GC a requirement for Frameworks in use in  
MacRuby seems to work well.

I guess I am just curious as to what exactly this mode would be like  
from the perspective of Ruby and from the perspective of Obj-C/Cocoa  
if it is introduced.

Laurent, is it possible to get more info publicly, or is this all  
still in really early stages, or private within Apple at this point?

Jordan

On Sep 23, 2009, at 19:05, Conrad Taylor wrote:

> In regards to a MacRuby application, you would need to use GC for  
> Objective-C.
>
> -Conrad
>
> On Wed, Sep 23, 2009 at 5:00 PM, Jordan Breeding <jordan.breeding at me.com 
> > wrote:
> But would the new MacRuby interpreter be smart enough to switch  
> between them and prefer GC Objc-C code, or would it be locked to one  
> or the other?
>
> Sent from my iPhone
>
> On Sep 23, 2009, at 18:56, Conrad Taylor <conradwt at gmail.com> wrote:
>
>> Hi, Objective-C could use GC and non-GC for memory management on  
>> the desktop.
>>
>> -Conrad
>>
>> On Wed, Sep 23, 2009 at 4:51 PM, Jordan Breeding <jordan.breeding at me.com 
>> > wrote:
>> So in that case Ruby would be garbage collected, but ObjC code it  
>> uses will be ref counted?
>>
>> Sent from my iPhone
>>
>>
>> On Sep 23, 2009, at 18:00, Laurent Sansonetti  
>> <lsansonetti at apple.com> wrote:
>>
>> Hi Conrad,
>>
>> The thing is, MacRuby is built on top of the ObjC GC, so there is  
>> currently no way you can not use it :)
>>
>> In the future we might introduce a mode where MacRuby doesn't use  
>> this GC, but it's all tentative.
>>
>> Laurent
>>
>> On Sep 23, 2009, at 3:58 PM, Conrad Taylor wrote:
>>
>> Laurent, I understand that one should use the GC for MacRuby but  
>> why do we have such a restriction?  Just curious about the history  
>> here.
>>
>> Thanks in advance,
>>
>> -Conrad
>>
>> On Wed, Sep 23, 2009 at 3:49 PM, Laurent Sansonetti <lsansonetti at apple.com 
>> > wrote:
>> Hi Robert,
>>
>> The problem here is dealloc. Same reason, dealloc is ignored by the  
>> runtime, and you should not use it in MacRuby, it will never be  
>> called.
>>
>> I just fixed macruby to not crash in case autorelease or dealloc is  
>> used, but keep in mind that using these selectors won't do anything.
>>
>> Laurent
>>
>>
>> On Sep 23, 2009, at 2:46 PM, Robert Rice wrote:
>>
>> Hi Laurent:
>>
>> Thanks for your quick reply. I have attached another file that  
>> causes a similar crash without a call to autorelease.
>>
>> Bob Rice
>> <OutlineRowNode.rb>
>>
>>
>>
>> On Sep 23, 2009, at 3:24 PM, Laurent Sansonetti wrote:
>>
>> Hi Robert,
>>
>> The problem is line 68, the call to autorelease. If you remove it  
>> it should load again. The reason is that autorelease (like release  
>> and retain) are ignored selectors of the runtime. Clearly we should  
>> not crash this way, I will fix that.
>>
>> Also, keep in mind that retain, release and autorelease should not  
>> be used in MacRuby. We run under GC mode which makes these calls no- 
>> ops.
>>
>> Laurent
>>
>> On Sep 23, 2009, at 12:18 PM, Robert Rice wrote:
>>
>> Hi Laurent:
>>
>> Thanks for your offer to help. Sorry I was busy with another  
>> project but now I get back to MacRuby.
>>
>> I have attached a file that causes the assertion error when loaded  
>> by the require command. Probably there is something else I need to  
>> change when porting from Ruby-Cocoa.
>>
>> Thanks,
>> Bob Rice
>> <JBH_F7575101_WindowController.rb>
>>
>> On Sep 12, 2009, at 3:08 PM, Laurent Sansonetti wrote:
>>
>> Hi Robert,
>>
>> Unless you found what was wrong, feel free to contact me off-list  
>> with a copy of your app and I will investigate the problem.
>>
>> Laurent
>>
>> On Sep 12, 2009, at 9:48 AM, Robert Rice wrote:
>>
>> Hi Laurent:
>>
>> It's a relatively large application that I ported from a RubyCocoa  
>> environment.
>> I need the threading support hook that was removed from Ruby in the  
>> Snow Leopard release.
>>
>> I'll try to track it down better by porting and testing modules a  
>> little at a time.
>>
>> Thanks,
>> Bob Rice
>>
>> On Sep 11, 2009, at 12:53 PM, Laurent Sansonetti wrote:
>>
>> Looks like we are hitting an assertion in the symbol generator...  
>> Could you send us what you are trying to execute here?
>>
>> Laurent
>>
>> Sent from my iPhone
>>
>> On Sep 11, 2009, at 9:48 AM, Robert Rice <rice.audio at pobox.com>  
>> wrote:
>>
>> How would I track down the following error from the nightly build?
>>
>> [Session started at 2009-09-11 12:43:22 -0400.]
>> GNU gdb 6.3.50-20050815 (Apple version gdb-1344) (Fri Jul  3  
>> 01:19:56 UTC 2009)
>> Copyright 2004 Free Software Foundation, Inc.
>> GDB is free software, covered by the GNU General Public License,  
>> and you are
>> welcome to change it and/or distribute copies of it under certain  
>> conditions.
>> Type "show copying" to see the conditions.
>> There is absolutely no warranty for GDB.  Type "show warranty" for  
>> details.
>> This GDB was configured as "x86_64-apple-darwin".tty /dev/ttys000
>> Loading program into debugger…
>> Program loaded.
>> run
>> [Switching to process 326]
>> Running…
>> Assertion failed: (1==0), function rb_intern3, file parse.y, line  
>> 9596.
>> Program received signal:  “SIGABRT”.
>> sharedlibrary apply-load-rules all
>> warning: Could not find object file "/Users/mattetti/src/macruby- 
>> gitsvn/trunk/array.o" - no debug information available for "array.c".
>>
>> warning: Could not find object file "/Users/mattetti/src/macruby- 
>> gitsvn/trunk/bignum.o" - no debug information available for  
>> "bignum.c".
>>
>> ...
>> Thanks,
>> Bob Rice
>>
>> On Sep 10, 2009, at 2:24 PM, Matt Aimonetti wrote:
>>
>> Latest trunk code available as an unofficial pkg ready to install: http://rubyurl.com/5K3W
>>
>> Lots of bug fixes, improved macgem (not finished yet but you can  
>> install gems and load them using `gem 'gem_name'; require  
>> 'whatever'`).
>> Things are looking pretty good on trunk :)
>>
>> - Matt
>> _______________________________________________
>> MacRuby-devel mailing list
>> MacRuby-devel at lists.macosforge.org
>> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>>
>> _______________________________________________
>> MacRuby-devel mailing list
>> MacRuby-devel at lists.macosforge.org
>> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>> _______________________________________________
>> MacRuby-devel mailing list
>> MacRuby-devel at lists.macosforge.org
>> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>>
>> _______________________________________________
>> MacRuby-devel mailing list
>> MacRuby-devel at lists.macosforge.org
>> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>>
>> _______________________________________________
>> MacRuby-devel mailing list
>> MacRuby-devel at lists.macosforge.org
>> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>>
>>
>> _______________________________________________
>> MacRuby-devel mailing list
>> MacRuby-devel at lists.macosforge.org
>> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>>
>> _______________________________________________
>> MacRuby-devel mailing list
>> MacRuby-devel at lists.macosforge.org
>> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>>
>>
>> _______________________________________________
>> MacRuby-devel mailing list
>> MacRuby-devel at lists.macosforge.org
>> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>>
>> _______________________________________________
>> MacRuby-devel mailing list
>> MacRuby-devel at lists.macosforge.org
>> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>>
>> _______________________________________________
>> MacRuby-devel mailing list
>> MacRuby-devel at lists.macosforge.org
>> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>>
>> _______________________________________________
>> MacRuby-devel mailing list
>> MacRuby-devel at lists.macosforge.org
>> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>> _______________________________________________
>> MacRuby-devel mailing list
>> MacRuby-devel at lists.macosforge.org
>> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>>
>> _______________________________________________
>> MacRuby-devel mailing list
>> MacRuby-devel at lists.macosforge.org
>> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>
> _______________________________________________
> MacRuby-devel mailing list
> MacRuby-devel at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>
>
> _______________________________________________
> MacRuby-devel mailing list
> MacRuby-devel at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-devel/attachments/20090923/3ca040cc/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3820 bytes
Desc: not available
URL: <http://lists.macosforge.org/pipermail/macruby-devel/attachments/20090923/3ca040cc/attachment-0001.bin>


More information about the MacRuby-devel mailing list