我应该学MacRuby还是RubyCocoa

时间:2022-09-11 10:23:07

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..

我想用ruby来学习mac的开发,但是我不知道该选哪个。RubyCocoa都已经存在很长时间了,但我认为MacRuby从长远来看会打败它。

Any suggestions??

有什么建议吗? ?

3 个解决方案

#1


37  

Go with MacRuby. It's the future :)

MacRuby。未来:)

It's newer, way faster, and much better integrated. HotCocoa is awesome as well.

它更新,速度更快,集成得更好。HotCocoa也很棒。

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.

MacRuby是在苹果技术之上实现的Ruby VM,而不是像RubyCocoa这样的桥。例如,Ruby字符串本质上是NSString,而不是由运行时连接。这是一种更清洁,更快,更可靠的方法。它也是由苹果公司开发和赞助的,这意味着它可能在某个时候成为OS X的一部分。

Also see this post: Why MacRuby Matters

也可以看看这篇文章:为什么MacRuby很重要

#2


8  

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.

由于Chuck回复了您,事情发生了很大的变化,MacRuby现在使用了LLVM,允许AOT编译,并且比以前更加稳定和快速。ruby方面仍然需要100%兼容,但是当我编写这个响应时,0.5仍然处于beta阶段,您应该会看到ruby库很快就能兼容了。

#3


7  

RubyCocoa is more mature and better tested. MacRuby is simpler and better designed overall. MacRuby is also about as stable as a lawn chair sitting on a beachball. Seriously. It's definitely the one you want to use in the long run, but it isn't there yet. They're not so different that you'd have to "learn" one versus the other. They're both just Ruby with access to the Cocoa APIs. It's more about knowing the Cocoa APIs than anything else.

RubyCocoa更成熟,测试也更好。MacRuby更简单,整体设计更好。MacRuby就像坐在沙滩球上的草坪椅一样稳定。认真对待。从长远来看,它肯定是你想要使用的,但它还没有出现。它们没有太大的不同,所以你必须“学习”其中一个。它们都是可以访问Cocoa api的Ruby。更重要的是了解Cocoa api。

I would recommend learning Cocoa with Objective-C. Once you have a good grasp on the central concepts of the framework (which are all based on Objective-C), then you can use Ruby if you still want to.

我建议使用Objective-C学习Cocoa。一旦您很好地掌握了框架的核心概念(它们都基于Objective-C),那么如果您还想使用Ruby的话,您就可以使用Ruby了。

Update 2011

The above is no longer true of MacRuby. It's very solid and fast enough to do most kinds of Cocoa applications in pure Ruby. The MacRuby team have also gone out of their way to be compatible with pretty much all of the system frameworks, even the C ones. If you like Ruby and want to do Mac development, it's definitely something to consider. There is no reason to choose RubyCocoa anymore unless you need to support ancient versions of OS X or PowerPC (MacRuby is strictly Intel 10.5+). The remaining caveats:

上述情况已不再适用于MacRuby。它非常可靠,速度足够快,可以在纯Ruby中执行大多数类型的Cocoa应用程序。MacRuby团队也已经尽力与几乎所有的系统框架兼容,即使是C框架。如果你喜欢Ruby并且想要做Mac的开发,这绝对是需要考虑的事情。没有理由再选择RubyCocoa,除非你需要支持旧版本的OS X或PowerPC (MacRuby是严格的Intel 10.5+)。其余事项:

  • Having to include MacRuby.framework in your apps puts a high lower boundary on bundle size (a couple dozen MB for "Hello World" IIRC)

    在应用程序中必须包含MacRuby.framework,这就为bundle的大小设置了一个较低的边界(Hello World IIRC需要几十MB)

  • Although it's stable in general, it's still very new beta software, so there are a few wrinkles in the less-used corners of the libraries (e.g. Pointers have a few quirks), and some design decisions aren't final (e.g. concurrency support is evolving rapidly)

    尽管总体来说它是稳定的,但它仍然是一个非常新的beta软件,所以在库中使用较少的角落(例如指针有一些怪癖)存在一些问题,并且一些设计决策不是最终的(例如,并发支持正在快速发展)

  • The documentation is still a work in progress, and lags behind the fast-moving language. A lot of articles you'll find about MacRuby suggest that HotCocoa is the cool, native way to make apps — it is a cool experiment, but it is now abandonware with some critical flaws that make it unsuitable for large-scale application development. The standard Xcode toolchain is the supported way to do MacRuby development.

    文档工作仍在进行中,落后于快速发展的语言。很多关于MacRuby的文章都认为HotCocoa都是一种很酷的、原生的应用开发方式——这是一个很酷的实验,但是它现在已经被抛弃了,因为它有一些关键的缺陷,不适合大规模的应用开发。标准的Xcode工具链是MacRuby开发的支持方式。

I also still recommend learning Cocoa with Objective-C, just because that's the framework's native language and thus the path of least resistance.

我仍然推荐使用Objective-C学习Cocoa,因为它是框架的母语,因此是阻力最小的途径。

#1


37  

Go with MacRuby. It's the future :)

MacRuby。未来:)

It's newer, way faster, and much better integrated. HotCocoa is awesome as well.

它更新,速度更快,集成得更好。HotCocoa也很棒。

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.

MacRuby是在苹果技术之上实现的Ruby VM,而不是像RubyCocoa这样的桥。例如,Ruby字符串本质上是NSString,而不是由运行时连接。这是一种更清洁,更快,更可靠的方法。它也是由苹果公司开发和赞助的,这意味着它可能在某个时候成为OS X的一部分。

Also see this post: Why MacRuby Matters

也可以看看这篇文章:为什么MacRuby很重要

#2


8  

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.

由于Chuck回复了您,事情发生了很大的变化,MacRuby现在使用了LLVM,允许AOT编译,并且比以前更加稳定和快速。ruby方面仍然需要100%兼容,但是当我编写这个响应时,0.5仍然处于beta阶段,您应该会看到ruby库很快就能兼容了。

#3


7  

RubyCocoa is more mature and better tested. MacRuby is simpler and better designed overall. MacRuby is also about as stable as a lawn chair sitting on a beachball. Seriously. It's definitely the one you want to use in the long run, but it isn't there yet. They're not so different that you'd have to "learn" one versus the other. They're both just Ruby with access to the Cocoa APIs. It's more about knowing the Cocoa APIs than anything else.

RubyCocoa更成熟,测试也更好。MacRuby更简单,整体设计更好。MacRuby就像坐在沙滩球上的草坪椅一样稳定。认真对待。从长远来看,它肯定是你想要使用的,但它还没有出现。它们没有太大的不同,所以你必须“学习”其中一个。它们都是可以访问Cocoa api的Ruby。更重要的是了解Cocoa api。

I would recommend learning Cocoa with Objective-C. Once you have a good grasp on the central concepts of the framework (which are all based on Objective-C), then you can use Ruby if you still want to.

我建议使用Objective-C学习Cocoa。一旦您很好地掌握了框架的核心概念(它们都基于Objective-C),那么如果您还想使用Ruby的话,您就可以使用Ruby了。

Update 2011

The above is no longer true of MacRuby. It's very solid and fast enough to do most kinds of Cocoa applications in pure Ruby. The MacRuby team have also gone out of their way to be compatible with pretty much all of the system frameworks, even the C ones. If you like Ruby and want to do Mac development, it's definitely something to consider. There is no reason to choose RubyCocoa anymore unless you need to support ancient versions of OS X or PowerPC (MacRuby is strictly Intel 10.5+). The remaining caveats:

上述情况已不再适用于MacRuby。它非常可靠,速度足够快,可以在纯Ruby中执行大多数类型的Cocoa应用程序。MacRuby团队也已经尽力与几乎所有的系统框架兼容,即使是C框架。如果你喜欢Ruby并且想要做Mac的开发,这绝对是需要考虑的事情。没有理由再选择RubyCocoa,除非你需要支持旧版本的OS X或PowerPC (MacRuby是严格的Intel 10.5+)。其余事项:

  • Having to include MacRuby.framework in your apps puts a high lower boundary on bundle size (a couple dozen MB for "Hello World" IIRC)

    在应用程序中必须包含MacRuby.framework,这就为bundle的大小设置了一个较低的边界(Hello World IIRC需要几十MB)

  • Although it's stable in general, it's still very new beta software, so there are a few wrinkles in the less-used corners of the libraries (e.g. Pointers have a few quirks), and some design decisions aren't final (e.g. concurrency support is evolving rapidly)

    尽管总体来说它是稳定的,但它仍然是一个非常新的beta软件,所以在库中使用较少的角落(例如指针有一些怪癖)存在一些问题,并且一些设计决策不是最终的(例如,并发支持正在快速发展)

  • The documentation is still a work in progress, and lags behind the fast-moving language. A lot of articles you'll find about MacRuby suggest that HotCocoa is the cool, native way to make apps — it is a cool experiment, but it is now abandonware with some critical flaws that make it unsuitable for large-scale application development. The standard Xcode toolchain is the supported way to do MacRuby development.

    文档工作仍在进行中,落后于快速发展的语言。很多关于MacRuby的文章都认为HotCocoa都是一种很酷的、原生的应用开发方式——这是一个很酷的实验,但是它现在已经被抛弃了,因为它有一些关键的缺陷,不适合大规模的应用开发。标准的Xcode工具链是MacRuby开发的支持方式。

I also still recommend learning Cocoa with Objective-C, just because that's the framework's native language and thus the path of least resistance.

我仍然推荐使用Objective-C学习Cocoa,因为它是框架的母语,因此是阻力最小的途径。