[MacRuby-devel] RoxorReturnFromBlockException*
>From what I can read in the archives, this was raised about 18 months
ago. Loosely following Matt's book, I've written the following code:
def showOpenPanel( sender)
openPanel = NSOpenPanel.openPanel
openPanel.setCanChooseDirectories( false)
openPanel.setShowsHiddenFiles( NSUserDefaults.standardUserDefaults.boolForKey(
'showHiddenFiles'))
openPanel.setAllowsMultipleSelection( true)
openPanel.beginSheetModalForWindow window, completionHandler:
Proc.new{|result|
return if (result == NSCancelButton)
# throws error
}
end
The result is (on OS X 10.7, MacRuby 0.10), when the cancel button is
pressed,
uncaught Objective-C/C++ exception...
terminate called after throwing an instance of
'RoxorReturnFromBlockException*'
Program received signal: “SIGABRT”.
sharedlibrary apply-load-rules all
Interestingly, on Lion, the output then appears to loop:
unable to read unknown load command 0x24
unable to read unknown load command 0x26
unable to read unknown load command 0x24
unable to read unknown load command 0x26
.
.
Do you need a new ticket?
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
Re: [MacRuby-devel] WWDC ?
I would have loved to come to the WWDC, but unfortunately can't make it... Sorry for the useless answer, just wanted to share my pain ;) On 28 mrt. 2011, at 22:25, Nick Ludlam wrote: > Hey all, > I was just wondering if Laurent or any of the other people involved with > MacRuby are planning to be at WWDC. > > > Nick > > ___ > MacRuby-devel mailing list > [email protected] > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel ___ MacRuby-devel mailing list [email protected] http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
Re: [MacRuby-devel] WWDC ?
Hah, well it turns out that I wasn't quick enough either, and I didn't get tickets. Selling out in under 12 hours is almost like some rock concert. On 30 Mar 2011, at 16:19, Eloy Duran wrote: > I would have loved to come to the WWDC, but unfortunately can't make it... > Sorry for the useless answer, just wanted to share my pain ;) > > On 28 mrt. 2011, at 22:25, Nick Ludlam wrote: > >> Hey all, >> I was just wondering if Laurent or any of the other people involved with >> MacRuby are planning to be at WWDC. >> >> >> Nick ___ MacRuby-devel mailing list [email protected] http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
Re: [MacRuby-devel] WWDC ?
I'll be there as well! -Robert On Mar 31, 2011, at 4:32 AM, Nick Ludlam wrote: > Hah, well it turns out that I wasn't quick enough either, and I didn't get > tickets. Selling out in under 12 hours is almost like some rock concert. > > On 30 Mar 2011, at 16:19, Eloy Duran wrote: > >> I would have loved to come to the WWDC, but unfortunately can't make it... >> Sorry for the useless answer, just wanted to share my pain ;) >> >> On 28 mrt. 2011, at 22:25, Nick Ludlam wrote: >> >>> Hey all, >>> I was just wondering if Laurent or any of the other people involved with >>> MacRuby are planning to be at WWDC. >>> >>> >>> Nick > > ___ > MacRuby-devel mailing list > [email protected] > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel ___ MacRuby-devel mailing list [email protected] http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
Re: [MacRuby-devel] RoxorReturnFromBlockException*
I think you want "break" instead of "return". You can't return from a block
(Proc).
-Gabriel
On Wed, Mar 30, 2011 at 7:53 AM, Martin Hawkins wrote:
> From what I can read in the archives, this was raised about 18 months
> ago. Loosely following Matt's book, I've written the following code:
> def showOpenPanel( sender)
>openPanel = NSOpenPanel.openPanel
>openPanel.setCanChooseDirectories( false)
>
> openPanel.setShowsHiddenFiles(
> NSUserDefaults.standardUserDefaults.boolForKey( 'showHiddenFiles'))
>openPanel.setAllowsMultipleSelection( true)
>openPanel.beginSheetModalForWindow window, completionHandler:
> Proc.new{|result|
> return if (result == NSCancelButton)
> # throws error
> }
> end
>
> The result is (on OS X 10.7, MacRuby 0.10), when the cancel button is
> pressed,
> uncaught Objective-C/C++ exception...
> terminate called after throwing an instance of
> 'RoxorReturnFromBlockException*'
> Program received signal: “SIGABRT”.
> sharedlibrary apply-load-rules all
>
> Interestingly, on Lion, the output then appears to loop:
> unable to read unknown load command 0x24
> unable to read unknown load command 0x26
> unable to read unknown load command 0x24
> unable to read unknown load command 0x26
> .
> .
> Do you need a new ticket?
> ___
> MacRuby-devel mailing list
> [email protected]
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
Re: [MacRuby-devel] RoxorReturnFromBlockException*
On 30 Mar 2011, at 18:23, Gabriel Gilder wrote:
> I think you want "break" instead of "return". You can't return from a block
> (Proc).
>
> -Gabriel
That's not strictly true, you can if the Proc.new { } object was initialized
within a method (like it is here).
However calling return explicitly will not return control to the caller.
Perhaps you could try a lambda, which behaves like a method when you use return
explicitly (returns control to the caller), or
use break as Gabriel suggested.
- Rob
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
Re: [MacRuby-devel] WWDC ?
I was able to grab a ticket in time too. Are there any MacRuby-related events planned yet? If not, we should coordinate an informal meetup. On Mar 30, 2011, at 10:12 AM, Robert Payne wrote: > I'll be there as well! > > -Robert > On Mar 31, 2011, at 4:32 AM, Nick Ludlam wrote: > >> Hah, well it turns out that I wasn't quick enough either, and I didn't get >> tickets. Selling out in under 12 hours is almost like some rock concert. >> >> On 30 Mar 2011, at 16:19, Eloy Duran wrote: >> >>> I would have loved to come to the WWDC, but unfortunately can't make it... >>> Sorry for the useless answer, just wanted to share my pain ;) >>> >>> On 28 mrt. 2011, at 22:25, Nick Ludlam wrote: >>> Hey all, I was just wondering if Laurent or any of the other people involved with MacRuby are planning to be at WWDC. Nick >> >> ___ >> MacRuby-devel mailing list >> [email protected] >> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > > ___ > MacRuby-devel mailing list > [email protected] > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel ___ MacRuby-devel mailing list [email protected] http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
Re: [MacRuby-devel] hotcocoa virus
Enzo, It might be a translation issue, but I wouldn't call that a virus (it doesn't replicate, it is just something that freezes your computer). I wouldn't call it "Virus" in the gist either, if I were you. If it is a bug in HotCocoa, than it may be a bug (or at least undesired functionality if it freezes your Mac) in MacRuby or OS X, so you might want to dig deeper and provide more info on version (and where you got it, since it is in various places in GitHub) of HotCocoa. Thanks! Gary On 3/29/11 5:27 PM, Vincenzo Piombo wrote: Hi all, I was trying to add drag & drop capabilities to a hotcocoa program and stumbled into a problem that really puzzles me: a macruby program can freeze your mac ! I uploaded the buggy fragment here: https://gist.github.com/893300 Don't run it unless you are prepared to reboot your machine the hard way, don't even "Force quit" works. In the instructions I say to launch it twice, but every drag & drop with any app after the crash freezes the app. I'm using macruby 0.9, tried 0.10 but hotcocoa does not work with it (but this is another story !) Hope someone can tell me if I did something wrong or found a bug somewhere. Enzp ___ MacRuby-devel mailing list [email protected] http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
Re: [MacRuby-devel] hotcocoa virus
Gary, "Virus" was joke of course, however I changed the name on gist. I doubt it is a hotcocoa issue, but as soon as I have some time will try to replicate it with an IB version. What do you mean by "where you got it" ? The code is mine, I was trying to do something along the lines of this http://www.nongnu.org/gstutorial/en/ch13s04.html. By the way, do you know where can I find a working drag&drop macruby example ? Enzo On Wed, Mar 30, 2011 at 11:17 PM, Gary Weaver wrote: > Enzo, > > It might be a translation issue, but I wouldn't call that a virus (it > doesn't replicate, it is just something that freezes your computer). I > wouldn't call it "Virus" in the gist either, if I were you. > > If it is a bug in HotCocoa, than it may be a bug (or at least undesired > functionality if it freezes your Mac) in MacRuby or OS X, so you might want > to dig deeper and provide more info on version (and where you got it, since > it is in various places in GitHub) of HotCocoa. > > Thanks! > Gary > > > On 3/29/11 5:27 PM, Vincenzo Piombo wrote: > > Hi all, > I was trying to add drag & drop capabilities to a hotcocoa program and > stumbled into a problem that really puzzles me: a macruby program can freeze > your mac ! > > I uploaded the buggy fragment here: https://gist.github.com/893300 > > Don't run it unless you are prepared to reboot your machine the hard way, > don't even "Force quit" works. > In the instructions I say to launch it twice, but every drag & drop with > any app after the crash freezes the app. > > > I'm using macruby 0.9, tried 0.10 but hotcocoa does not work with it (but > this is another story !) > > Hope someone can tell me if I did something wrong or found a bug > somewhere. > > Enzp > > > > > > ___ > MacRuby-devel mailing list > [email protected] > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > > ___ MacRuby-devel mailing list [email protected] http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
Re: [MacRuby-devel] WWDC ?
At 12:36 PM -0700 3/30/11, Christian Niles wrote: > Are there any MacRuby-related events planned yet? > If not, we should coordinate an informal meetup. Works for me, particularly if it's in a venue that's open to the general public. We can list it on SFRuby and let folks meet each other... -r -- http://www.cfcl.com/rdmRich Morin http://www.cfcl.com/rdm/resume [email protected] http://www.cfcl.com/rdm/weblog +1 650-873-7841 Software system design, development, and documentation ___ MacRuby-devel mailing list [email protected] http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
Re: [MacRuby-devel] WWDC ?
> At 12:36 PM -0700 3/30/11, Christian Niles wrote: > > Are there any MacRuby-related events planned yet? > > If not, we should coordinate an informal meetup. > Good idea, it would be cool to meet up with some other MacRubyists. ___ MacRuby-devel mailing list [email protected] http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
Re: [MacRuby-devel] WWDC ?
On Mar 30, 2011, at 19:09 , Andre Lewis wrote: > > At 12:36 PM -0700 3/30/11, Christian Niles wrote: > > Are there any MacRuby-related events planned yet? > > If not, we should coordinate an informal meetup. > > Good idea, it would be cool to meet up with some other MacRubyists. I'd be interested in meeting up, too. Looking forward to my first WWDC. /ls ___ MacRuby-devel mailing list [email protected] http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
Re: [MacRuby-devel] WWDC ?
Looking at http://www.sfruby.info/#upcoming, I don't see anything scheduled during WWDC (June 6-10). If the WWDC attendees in the crowd can settle on a date (ideally, one that works for Jordan and Laurent :-), I'll be happy to put in the schedule. I can probably also find a venue for the event; let me know if this is an issue... -r -- http://www.cfcl.com/rdmRich Morin http://www.cfcl.com/rdm/resume [email protected] http://www.cfcl.com/rdm/weblog +1 650-873-7841 Software system design, development, and documentation ___ MacRuby-devel mailing list [email protected] http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
[MacRuby-devel] Tyro Needs Ruby vs. O-C Advice
I've decided to use an upcoming sabbatical to teach myself OS X and iOS programming. My background includes OS X systems administration and web development, mostly using the Apache/MySQL/PHP model. I'm familiar with OOP concepts and have trifled with any number of languages from C to AppleScript, but am not fluent in any object oriented language. I've been exploring Xcode 4 for a week and feel conversant with the IDE if not yet able to accomplish anything with it. So… I understand that Cocoa is a given, but today's million dollar question is Objective-C or MacRuby? I'm a blank slate with regard to both and so could use some good advice. For example… What are the advantages of MacRuby over Objective-C? What are the advantage of O-C over Ruby? Is Xcode's support for O-C significantly better than it's handling of Ruby? Do I care? At this point I'm primarily interested in OS X development, but iOS clearly needs to run a close second. What's the current status of Ruby development for iOS and is it likely to go anywhere in the nearish future? Any thoughts on the longer-term prospects of either language? Any thoughts from anybody will be much appreciated. Thanks, Bryan___ MacRuby-devel mailing list [email protected] http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
Re: [MacRuby-devel] Tyro Needs Ruby vs. O-C Advice
Just a suggestion but I think having a goal will determine what you use.
MacRuby will still expose you to the Cocoa libraries so you will be able to
interchange with OBJC easily.
The MacRuby style tho gets my vote... e.g.
(OBJC) NSMutableDictionary* myDict = [[NSMutableDictionary alloc]init];
(MacRuby) mydict = {}
it may just be a verbosity thing but once you get used to the Macruby style
OBJC becomes tedious.
heres hoping with multiple cores etc that a garbage collector can be added to
IOS! which I think is the only reason MacRuby would not work with it.
Terry
On 31/03/2011, at 4:43 PM, Bryan Harrison wrote:
> I've decided to use an upcoming sabbatical to teach myself OS X and iOS
> programming. My background includes OS X systems administration and web
> development, mostly using the Apache/MySQL/PHP model. I'm familiar with OOP
> concepts and have trifled with any number of languages from C to AppleScript,
> but am not fluent in any object oriented language. I've been exploring Xcode
> 4 for a week and feel conversant with the IDE if not yet able to accomplish
> anything with it.
>
> So… I understand that Cocoa is a given, but today's million dollar question
> is Objective-C or MacRuby? I'm a blank slate with regard to both and so
> could use some good advice. For example…
>
> What are the advantages of MacRuby over Objective-C?
>
> What are the advantage of O-C over Ruby?
>
> Is Xcode's support for O-C significantly better than it's handling of Ruby?
> Do I care?
>
> At this point I'm primarily interested in OS X development, but iOS clearly
> needs to run a close second. What's the current status of Ruby development
> for iOS and is it likely to go anywhere in the nearish future?
>
> Any thoughts on the longer-term prospects of either language?
>
> Any thoughts from anybody will be much appreciated.
>
> Thanks,
> Bryan
> ___
> MacRuby-devel mailing list
> [email protected]
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
Re: [MacRuby-devel] Tyro Needs Ruby vs. O-C Advice
On Mar 30, 2011, at 9:56 PM, Terry Moore wrote: > it may just be a verbosity thing but once you get used to the Macruby style > OBJC becomes tedious. Hell, I spend most of my time in C++, and I find the ojbc verbosity to be tedious ;-) -- Scott Ribe [email protected] http://www.elevated-dev.com/ (303) 722-0567 voice ___ MacRuby-devel mailing list [email protected] http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
Re: [MacRuby-devel] Tyro Needs Ruby vs. O-C Advice
I'm not a MacRuby or ObjC expert, but here is my understanding. > What are the advantages of MacRuby over Objective-C? MacRuby is a variant of Ruby, so it's an interpreted, concise, dynamic language. Objective-C is a compiled language based on C (with a lot of run-time support). So, a MacRuby program will generally be shorter than the corresponding Objective-C program and may be able to do tricks (eg, using metaprogramming) that the ObjC program cannot. That said, an Objective-C program can do anything that a MacRuby program can, though generally with quite a bit more code. > What are the advantage of O-C over Ruby? MacRuby has JIT (Just In Time compilation), so it will speed up over time. ObjC is a compiled language, so it runs fast from the beginning. > Is Xcode's support for O-C significantly better than > its handling of Ruby? Do I care? Sorry, I don't know. > At this point I'm primarily interested in OS X development, > but iOS clearly needs to run a close second. What's the > current status of Ruby development for iOS and is it likely > to go anywhere in the nearish future? Ruby expects a garbage collector to be available. iOS does not supply one, so that's currently a show-stopper. > Any thoughts on the longer-term prospects of either language? ObjC is only used (to a first approximation) by Apple and folks who are programming for Apple environments. Ruby is a popular web development language and it can also be used for general scripting. I don't see either language going away any time soon, but Ruby is a more portable job skill: there are lots of companies who who hire Ruby programmers; there are far fewer companies who hire ObjC programmers. -r -- http://www.cfcl.com/rdmRich Morin http://www.cfcl.com/rdm/resume [email protected] http://www.cfcl.com/rdm/weblog +1 650-873-7841 Software system design, development, and documentation ___ MacRuby-devel mailing list [email protected] http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
Re: [MacRuby-devel] Tyro Needs Ruby vs. O-C Advice
Greetings, Hell, I spend most of my time in Java, and I find the objc verbosity to be...uhhh...pretty familiar. ;) Joking aside, I'll often take common ObjC patterns and 're-do' them the Ruby way so they're more efficient to the way my brain works. As an example from a recent bit of code, you have: NSArray *dropTypes = [NSArray* *arrayWithObjects:"BookmarkDictionaryListPboardType", "MozURLType", NSFilenamesPboardType, NSURLPboardType, NSStringPboardType, nil]; versus dropTypes = ["BookmarkDictionaryListPboardType", "MozURLType", NSFilenamesPboardType, NSURLPboardType, NSStringPboardType] The first is remarkably flexible in rare cases, but exceptionally annoying for the common case. To try and answer the questions, though... - What are the advantages of MacRuby over Objective-C? - An easy to learn, concise syntax in a language designed for the pleasure of programming but with enough power for all but the toughest problems - Being interpreted means you can try things very quickly, and not have to go through a compile cycle for each time you just want to see how something works. - A ton of 'gem' libraries that do very cool things in natural way - What are the advantage of O-C over Ruby? - Compiled, so marginally faster (although MacRuby's compilation is getting better) - All the examples of doing MacOS X programming out there are in Objective C, so you have to translate - A decent number of native libraries which, while you can use them in MacRuby, are easier to use in Objective C - *iOS programming* - Is Xcode's support for O-C significantly better than it's handling of Ruby? Do I care? - Yes, it is better. No, I don't find it better enough that I care very much. Symbol completion doesn't work great in MacRuby, but it doesn't bother me much. - At this point I'm primarily interested in OS X development, but iOS clearly needs to run a close second. What's the current status of Ruby development for iOS and is it likely to go anywhere in the nearish future? - The garbage-collection requirement makes this a non-starter right now. It might get better, *it might not.* I do iOS programming in Objective C, and Mac OS X programming in MacRuby. It helps me keep my hand in Objective C development, so I'm always able to translate between Objective C and MacRuby, while letting me build a desktop app in my favorite language of all time, so far. :) - Any thoughts on the longer-term prospects of either language? - Ruby itself is likely to remain a strong contender for many years. MacRuby has just started being shipped, albiet as a private framework, by Apple. This bodes well, but as the Java OS X developers can tell you with a touch of sadness...things change. Hope that helps some! -- Morgan ___ MacRuby-devel mailing list [email protected] http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
Re: [MacRuby-devel] RoxorReturnFromBlockException*
On further digging, it seems like the exception raised when you return from
a block (/Proc/lambda) is MacRuby specific. Seems like this should have been
fixed a while ago:
http://www.macruby.org/trac/ticket/412
I wonder if this bug should be re-opened? I actually encountered a similar
problem recently, and it was entirely within the scope of Ruby code I had
written, so it doesn't seem like this could be an issue with how the Cocoa
code is calling the Proc in Martin's example.
I'm hoping Laurent or someone can offer some ideas on this, because I'm
still a little confused as to how exactly this exception. For instance,
consider this code that's hooked up to a button's action:
def trigger_action(sender)
a_proc = Proc.new { |var|
puts "hello in proc"
return 1
}
a_proc.call('test')
puts "hello after proc"
end
That code runs without triggering an exception, and prints only "hello in
proc" as expected. However, this variation on the code behaves differently:
def trigger_action(sender)
a_proc = Proc.new { |var|
puts "hello in proc"
return 1
}
a_lam = lambda { |var|
puts "hello in lambda"
return 1
}
a_lam.call('test')
puts "hello after lambda"
a_proc.call('test')
puts "hello after proc"
end
Now the code outputs the following:
*hello in lambda*
*hello after lambda*
*hello in proc*
*uncaught Objective-C/C++ exception...*
*terminate called after throwing an instance of
'RoxorReturnFromBlockException*'*
Program received signal: “SIGABRT”.
sharedlibrary apply-load-rules all
I can't quite understand why.
Anybody?
-Gabriel
On Wed, Mar 30, 2011 at 11:05 AM, Rob Gleeson wrote:
>
> On 30 Mar 2011, at 18:23, Gabriel Gilder wrote:
>
> > I think you want "break" instead of "return". You can't return from a
> block (Proc).
> >
> > -Gabriel
>
> That's not strictly true, you can if the Proc.new { } object was
> initialized within a method (like it is here).
> However calling return explicitly will not return control to the caller.
>
> Perhaps you could try a lambda, which behaves like a method when you use
> return explicitly (returns control to the caller), or
> use break as Gabriel suggested.
>
> - Rob
> ___
> MacRuby-devel mailing list
> [email protected]
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
[MacRuby-devel] How to do Drag and Drop
Greetings, On Wed, Mar 30, 2011 at 2:32 PM, Vincenzo Piombo wrote: > By the way, do you know where can I find a working drag&drop macruby > example ? > > Enzo > Well...crud. My email on this got eaten because I used syntax highlighted code which bulked the email beyond the 40k limit on the mailing list. You can view my drag-and-drop answer here: https://docs.google.com/document/pub?id=1htdHAArZ0g0ooDiSdTJ89vUhUHmPoHJjlsF9MNrYA1A Hopefully it helps... I should build it into a proper blog post and gists and stuff... -- Morgan Schweers, CyberFOX! On Wed, Mar 30, 2011 at 11:17 PM, Gary Weaver wrote: > >> Enzo, >> >> It might be a translation issue, but I wouldn't call that a virus (it >> doesn't replicate, it is just something that freezes your computer). I >> wouldn't call it "Virus" in the gist either, if I were you. >> >> If it is a bug in HotCocoa, than it may be a bug (or at least undesired >> functionality if it freezes your Mac) in MacRuby or OS X, so you might want >> to dig deeper and provide more info on version (and where you got it, since >> it is in various places in GitHub) of HotCocoa. >> >> Thanks! >> Gary >> >> >> On 3/29/11 5:27 PM, Vincenzo Piombo wrote: >> >> Hi all, >> I was trying to add drag & drop capabilities to a hotcocoa program and >> stumbled into a problem that really puzzles me: a macruby program can freeze >> your mac ! >> >> I uploaded the buggy fragment here: https://gist.github.com/893300 >> >> Don't run it unless you are prepared to reboot your machine the hard >> way, don't even "Force quit" works. >> In the instructions I say to launch it twice, but every drag & drop with >> any app after the crash freezes the app. >> >> >> I'm using macruby 0.9, tried 0.10 but hotcocoa does not work with it >> (but this is another story !) >> >> Hope someone can tell me if I did something wrong or found a bug >> somewhere. >> >> Enzp >> >> >> >> >> >> ___ >> MacRuby-devel mailing list >> [email protected] >> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel >> >> > > ___ > MacRuby-devel mailing list > [email protected] > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > > ___ MacRuby-devel mailing list [email protected] http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
Re: [MacRuby-devel] Tyro Needs Ruby vs. O-C Advice
On Mar 30, 2011, at 8:43 PM, Bryan Harrison wrote: > So… I understand that Cocoa is a given, but today's million dollar question > is Objective-C or MacRuby? I'm a blank slate with regard to both and so > could use some good advice. For example… > > What are the advantages of MacRuby over Objective-C? > > What are the advantage of O-C over Ruby? Well, do bear in mind that you also asked this question in the MacRuby list. Were you genuinely hoping for un-biased answers? ;-) That said, I'll do my best to represent the other side of the argument even though I'm actually an old C hacker (generally avoiding higher-level languages by choice) and have no real personal preference either way. The advantages of ObjC over Ruby are: 1. Objective-C is definitely the main game in town on Mac OS X / iOS. When it comes to interoperability with 3rd party libraries, sample code / tutorials for either platform or documentation, you're generally going to find that ObjC is always first in line as far as priorities are concerned. 2. Objective-C (and/or C at "the POSIX layer") will give you the greatest flexibility in programming for the platform. Whereas Ruby always drags its runtime around with it, the lower-level languages don't have as much baggage and can be used in a wider variety of situations, such as programming for the kernel (C only of course) or creating plug-ins for other systems like Audio Units, Core Graphics Filters, Authorization plug-ins and so on. 3. Most new API comes to C/ObjC first, often being later "wrapped" in MacRuby in some way, but now you have to rely on either the MR folks to get around to it or the new API being introspectable/bridgesupport-able enough to be called without a wrapper. The advantages of Ruby / MacRuby have already been listed by others, though I'm not sure job security is necessarily one of them. I see a lot of job postings for C and ObjC programmers, the various app stores having created something of a "gold rush" for them, just as the web development boom gave Ruby programming a boost through Rails. - Jordan ___ MacRuby-devel mailing list [email protected] http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
