PyObjc vs RubyCocoa for Mac开发:哪个更成熟? [英] PyObjc vs RubyCocoa for Mac development: Which is more mature?

查看:140
本文介绍了PyObjc vs RubyCocoa for Mac开发:哪个更成熟?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我一直想玩Ruby或Python,而同时我想做一些Cocoa编程。所以我认为实现这两个目标的最好方法是使用Ruby或Python到Objective-C桥(PyObjc或RubyCocoa)开发一些东西。



我知道理想的是获得最好的学习经验我会独立学习每个技术学,但我没有时间。 :)



所以我的问题是哪个是更成熟的平台,PyObc或RubyCocoa,我正在寻找的主要事情:


  1. API的文档

  2. 教程

  3. 工具

  4. 支持


  5. 关于第5点我不会期望整个Cocoa API将通过任一桥接,但我需要有足够的Cocoa API来开发一个正常运行的应用程序。

    解决方案

    p>我会回应Chris的assesment,并将扩展一点为什么你应该学习Objective-C学习Cocoa。正如Chris所说,Objective-C是Cocoa的基础和母语,它的许多范例与这个谱系密不可分。特别地,选择器和动态消息解析以及在运行时修改类的能力是实现Cocoa技术(如分布式对象和绑定)所必需的。虽然这些功能在其他动态语言(如Ruby和Python)中可用,但是在语言模型中有足够的不匹配,您至少需要理解Objective-C才能理解Cocoa。我建议你看看这个以前的问题进一步讨论:我必须学习Objective-C专业的Mac开发吗?



    幸运的是,Objective-C非常容易学习。我经常告诉人们,他们需要一天时间来学习Objective-C来自C / C ++ / Java或LISP,Scheme,或者任何一种新的动态语言,比如Ruby和Python。除了扩展你的心,有一点,你会学到至少阅读几乎所有Cocoa文档和示例中使用的代码。



    对于Ruby与Python,桥的功能非常相似。事实上,他们都使用Apple的 BridgeSupport (与Leopard一起提供)来提供网桥描述。两者都支持苹果和船与豹。这是一个个人的口味你喜欢哪种语言。如果您选择Ruby,我建议您提供 MacRuby 外观。这绝对是Ruby on OS X的未来,因为它在Objective-C运行时之上重新实现了Ruby运行时。这提供了一些不错的性能和概念上的优势(包括与Objective-C垃圾收集系统的集成,目前在使用本地python gc的PyObjC中缺少的功能)。 MacRuby还包括一个自定义解析器,使桥接的目标c方法的语法更好一点。 MacRuby的缺点是,它在本文撰写时(2009年6月)还没有准备好用于生产级别的使用。因为听起来这是一个学习项目,这可能不是一个问题。


    I've been wanting to have a play with either Ruby or Python while at the same time I've been wanting to do a bit of Cocoa programming.

    So I thought the best way to achieve both these goals is to develop something using either a Ruby or Python to Objective-C bridge (PyObjc or RubyCocoa).

    I know that ideally to get the best learning experience I would learn each techonology independently but I don't have the time. :)

    So my question is which is a more mature platform, PyObc or RubyCocoa, main things I am looking for:

    1. Documentation of API
    2. Tutorials
    3. Tools
    4. Supportive Community
    5. Completness of Cocoa API avaialble through the bridge

    Regarding point 5 I don't expect that the entire Cocoa API will be availble through either bridge but I need to have enough Cocoa APIs available to develop a functioning application.

    解决方案

    I would echo Chris' assesment and will expand a bit on why you should learn Objective-C to learn Cocoa. As Chris says, Objective-C is the foundation and native language of Cocoa and many of its paradigms are inextricably linked with that lineage. In particular, selectors and dynamic message resolution and ability to modify classes at run time are required to implement Cocoa technologies such as Distributed Objects and bindings. Although these features are available in other dynamic languages such as Ruby and Python, there is enough of a mismatch in the language models that you will have to at least understand Objective-C to understand Cocoa. I suggest you take a look at this previous question for further discussion: Do I have to learn Objective-C for professional Mac Development?

    Fortunately, Objective-C is very easy to learn. I often tell people it will take them a day to learn Objective-C coming from C/C++/Java or LISP, Scheme, or any of the 'newer' dynamic languages such as Ruby and Python. In addition to expanding your mind a bit, you'll learn to at least read the code that is used in virtually all of the Cocoa documentation and examples.

    As for Ruby vs. Python, the bridge capabilities are very similar. In fact, they both use Apple's BridgeSupport (shipped with Leopard) to provide the bridge description. Both are supported by Apple and ship with Leopard. It's a matter of personal taste which language you prefer. If you choose Ruby, I suggest you give MacRuby a look. It's definitely the future of Ruby on OS X, as it reimplements the Ruby runtime on top of the Objective-C run time. This provides some nice performance and conceptual advantages (including integration with the Objective-C garbage collection system, a feature currently lacking in PyObjC which uses the native python gc). MacRuby also includes a custom parser that makes the syntax of bridged objective-c methods a little nicer. The downside of MacRuby is that it's not quite ready for production-level use at the time of this writing (June 2009). Since it sounds like this is a learning project for you, that's probably not an issue.

    这篇关于PyObjc vs RubyCocoa for Mac开发:哪个更成熟?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆