MacRuby Icon

MacRuby

MacRuby is a unique blend of Ruby 1.9 and Objective-C.

MacRubyOverview

MacRuby is a unique blend of Ruby 1.9 and Objective-C. The goal of the MacRuby project is to be 100% compatible syntactically and behaviorally with Ruby 1.9. Because of the project’s goals of seamless integration with Objective-C, however, there are significant differences in the internals of the runtime. The following presents an overview of what is unique to MacRuby vs. the standard Ruby 1.9 ‘MRI’ interpreter.
Class and Object Model

Ruby classes in MacRuby are in fact Objective-C classes. Because it is not yet possible to completely express the Ruby semantics with the Objective-C runtime, some extra bits are still being allocated per class. For example, Objective-C doesn’t allow instance variables to be added at runtime to a class, or classes to be nested, so MacRuby has to work around that.

Every method defined on a class from Ruby is registered with the Objective-C runtime. On a similar note, all Objective-C methods are lazily available from Ruby too. The [Libffi] library is used to Create closures at runtime and inject them, either in the Objective-C runtime or YARV, but also to perform C or Objective-C calls.

All Ruby classes inherit from NSObject, the root class of most Objective-C objects in the Cocoa world. This means that by default, all Ruby objects respond to a bunch of handful methods defined in NSObject, including some that are required by the GC.

Objective-C classes are imported in the Ruby runtime on demand, along with their full hierarchy.

All Ruby objects are actually Objective-C objects. The basic Ruby object structure was modified to conform to the basic Objective-C object structure. This means that Ruby objects can be passed to the Objective-C runtime without any conversion. They will be recognized in the Objective-C world because they have an Objective-C class.

Vice-versa, Objective-C objects can be passed to the Ruby VM without any conversion. They will be recognized as pure Objective-C objects.

NEW

Fixed some bugs.

MacRubyInformation

Version
0.5
Date
03.26.10
License
Free
Language
English
File Size
40.9MB
Developer
Category
Operating Systems
Mac OS X
System Requirements
No additional system requirements.
Apple GarageBand Icon
Complete recording studio and more.
Paid
WebKit Icon
Open-Source Web-browser engine.
Free
Apple Xcode Icon
Integrated development environment (IDE) for OS X.
Free
Apple OS X Server Icon
The OS X Server brings more power to your business, home office or school.
Paid
Apple MainStage Icon
Live performance tool for musicians.
Paid
Apple Pro Video Formats Icon
Updates for professional-level codecs.
Free
Apple iOS Icon
The latest version of Apple's mobile OS.
Free
Apple iTunes Icon
Play Apple Music and manage your media and iOS devices.
Free
More
Nite Flite Script Library Icon
A collection of script libraries that implement basic computer science structure
Free
Adobe AIR Icon
Deploy Web applications on your desktop.
Free
RubyMine Icon
Full-fledged IDE for Ruby on Rails.
Trial
Xojo Plugins Icon
Adds thousands of new classes to Xojo. (was Real Studio Plugins).
Trial
Apple Xcode Icon
Integrated development environment (IDE) for OS X.
Free
Google App Engine SDK Icon
Run your Web applications on Google.
Free
Mono Icon
Open-Source implementation of Microsoft's .NET framework.
Free
Omnis Studio Icon
Visual RAD tool for professional data management.
Demo
More