Hacker News new | past | comments | ask | show | jobs | submit login

Put simply: no. RubyMotion works because Ruby and Objective-C are very similar internally, both being inspired by SmallTalk and sharing almost all "core" language features - it allows to run ruby code on Objective-C Runtime. In this regard, python is a very different language, that would be extremely difficult to port, and it wouldn't really feel like python.



Well, sort of. I wouldn't really call it running "ruby code on the Objective-C runtime". Your Ruby code is effectively being converted to Cocoa API calls during the compilation process. RubyMotion has a number of Objective-C subclasses that match back to Ruby objects (for example, strings in RubyMotion aren't NSStrings, but a subclass of them). If you dump the headers out of a RubyMotion app you can pretty clearly see this.

Ruby and Objective-C definitely aren't that similar internally - as someone else has suggested, there's no technical reason you couldn't do something similar for Python. It just happens that Ruby to Cocoa bindings have been around for a while (for some time with Apple support), and as a result there has been generally more interest in carrying it forward.

I've probably failed to adequately explain how it works, but the MacRuby source is available on GitHub, and Laurent Sansonetti has done a run through how RubyMotion does it's thing here: http://rubysource.com/laurent-sansonetti-on-rubymotion-inter...


Thanks! I knew most of this, but for some reason had an impression that ruby was in particularly nice spot to subclass Obj-C classes. I have to agree, you are right, and other languages could follow RubyMotion's model.


I don't think RubyMotion exists because like Obj-C it was inspired by SmallTalk. Well maybe it is, but that doesn't mean it's an insurmountable barrier that would render a similar project in python impossible or "un-python like". C#/.NET got the treatment a long time ago, http://xamarin.com/. It's just that (it appears) no company or OS developer has taken on the challenge of creating the tooling for python.




Consider applying for YC's W25 batch! Applications are open till Nov 12.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: