I am wanting to learn mac development with ruby but I'm not sure which one to go at. RubyCocoa has been around longer but I think MacRuby will beat it out in the long run..
Any suggestions??
I am wanting to learn mac development with ruby but I'm not sure which one to go at. RubyCocoa has been around longer but I think MacRuby will beat it out in the long run..
Any suggestions??
Go with MacRuby. It's the future :)
It's newer, way faster, and much better integrated. HotCocoa is awesome as well.
MacRuby is a Ruby VM implemented on top of Apple Technologies as opposed to a bridge like RubyCocoa. A Ruby String for example is an NSString by nature, instead of being bridged by the runtime. It's a much cleaner, faster and more solid approach. It's also developed and sponsored by Apple, which means it could become part of OS X at some point.
Also see this post: Why MacRuby Matters
Since Chuck replied to you, things changed quite a lot, MacRuby now uses LLVM, allows for AOT compilation and is quite stable and much faster than it used to be. The ruby side of things still need some work for be 100% compatible but as I'm writing this response, 0.5 is still in beta and you should see ruby libraries being compatible very quickly.
RubyCocoa 更加成熟并且经过更好的测试。MacRuby 更简单,整体设计更好。MacRuby 也与坐在沙滩球上的草坪椅一样稳定。严重地。从长远来看,它绝对是您想要使用的那个,但它还没有。它们并没有太大的不同,以至于您必须“学习”一个与另一个。它们都是可以访问 Cocoa API 的 Ruby。了解 Cocoa API 比其他任何事情都重要。
我建议使用 Objective-C 学习 Cocoa。一旦你很好地掌握了框架的核心概念(都是基于 Objective-C 的),那么如果你仍然想使用 Ruby,你就可以使用 Ruby。
上述情况不再适用于 MacRuby。它非常稳定和快速,足以在纯 Ruby 中完成大多数类型的 Cocoa 应用程序。MacRuby 团队也竭尽全力兼容几乎所有的系统框架,甚至包括 C 框架。如果你喜欢 Ruby 并想做 Mac 开发,那绝对是值得考虑的事情。没有理由再选择 RubyCocoa,除非您需要支持旧版本的 OS X 或 PowerPC(MacRuby 严格来说是 Intel 10.5+)。剩下的注意事项:
必须在您的应用程序中包含 MacRuby.framework 会降低捆绑包大小的上限(“Hello World”IIRC 需要几十 MB)
虽然它总体上是稳定的,但它仍然是非常新的测试版软件,所以在库的较少使用的角落有一些皱纹(例如指针有一些怪癖),并且一些设计决策不是最终的(例如并发支持是发展迅速)
该文档仍在进行中,并且落后于快速发展的语言。您会发现很多关于 MacRuby 的文章都表明,HotCocoa 是制作应用程序的一种很酷的原生方式——它是一个很酷的实验,但它现在已被废弃,存在一些使其不适合大规模应用程序开发的关键缺陷。标准的 Xcode 工具链是进行 MacRuby 开发的受支持方式。
我还推荐使用 Objective-C 学习 Cocoa,因为那是框架的原生语言,因此阻力最小。