Thursday, April 12, 2012

MACRUBY--- It's just ruby mac.. :)

Recently I read when I saw "MACRUBY" in hacker's shelf, I couldn't resist myself to pick one of these books.Have look about in the link below:
http://hackershelf.com/book/69/macruby/
  
When I started going through this book I felt , I was reading Nu Language details one more time... but it's different trust me. Don't loose me here.I love to code in ruby. I have used Ruby cocoa in the past. Mac Ruby is better in other words as u have the best of Ruby 1.9 + Objective C. Its the best for native OS problems.Learning MacRuby does not require you to rem Object C(Atleast I saw the last Object C code in year 2007!!! so i was like OBJECT C.. I don't think I rem anything)

Best things about MacRuby is it uses YARV(Yet Another Ruby VM) which is a byte code interpreter.. performance time is great in this VM and not MAtz ruby interpreter.Time difference is like 16 sec : 5 sec. 

MacRuby Threads implementation is way beyond ruby as they are native thread and unlike ruby which was impossible to call back from p-threads.This can be done pretty easily using MacRuby.So where is Object C popping in... :) When We look into the performacnec scale of the garbage collector of ruby it is veryyyyy slow, Mac Ruby uses Object C for the rescue.The new Objective-C garbage collector engine, due to its generational nature, performs fast collections. It also doesn't stop the world while collecting memory, because collections are done in a separate thread.In MacRuby, all Ruby classes and objects are actually Objective-C classes and objects. There is no need to create costly proxies, convert objects, and cache instances. A Ruby object can be cast (toll-free) at the C level as an Objective-C object. The Ruby VM can also handle incoming Objective-C objects without conversion.
In MacRuby, the primitive Ruby classes (e.g., String, Array, and Hash) have been re-implemented on top of their Cocoa equivalents (respectively, NSString, NSArray, and NSDictionary). As an example, all strings in MacRuby are Cocoa strings, so they can be passed directly to underlying C or Objective-C APIs. It is also possible to call any method of the String interface on any Cocoa string, subclass Objective-C methods, etc.Need to test with audio codecs and image processing implementations.
Will post my video aggregation in twitter using MACRuby 0.10 shortly in My GIT account, keep following it.
Mac Ruby is nothing but RUBY 1.9 with MACOSX Framework On Mac






and it ROCKS!!!! 

No comments:

Post a Comment