[ANN] MacRuby 0.2

  • Thread starter Laurent Sansonetti
  • Start date
L

Laurent Sansonetti

Hi,

After 3 months of development, here comes the second release of
MacRuby, 0.2! Check it out while it's still hot!

MacRuby is a version of Ruby 1.9, ported to run directly on top of Mac
OS X core technologies such as the Objective-C common runtime and
garbage collector, and the CoreFoundation framework. While still a
work in progress, it is the goal of MacRuby to enable the creation of
full-fledged Mac OS X applications which do not sacrifice performance
in order to enjoy the benefits of using Ruby.

You can learn more about MacRuby, and download a binary installer,
from the website:

http://ruby.macosforge.org

This is an important release, addressing many bugs, but also
re-implementing parts of the runtime using the CoreFoundation
framework.

In MacRuby 0.2, all strings, arrays and hashes are now native Cocoa
types, respectively NSString, NSArray and NSDictionary objects. The
entire String, Array and Hash interface was rewritten on top of the
Cocoa equivalents, using the powerful CoreFoundation framework. The
previous implementation, inherited from MRI, is not used anymore.

The rationale behind this change is simple. It is not necessary
anymore to convert Ruby primitive types to Cocoa, or vice-versa. For
example, a String created in MacRuby can be passed as is, without
conversion, to an underlying C or Objective-C API that expects an
NSString. And vice-versa, any method of the Ruby String class can be
performed on an NSString that comes from Objective-C.

Enjoy,

Laurent
 
U

Une Bévue

Laurent Sansonetti said:
After 3 months of development, here comes the second release of
MacRuby, 0.2! Check it out while it's still hot!

Aparently the "MacRuby 0.2.pkg" needs Leopard, i'm running 10.4.11.

installing it thru svn + compil could work on a PPC G5 ???
 
L

Laurent Sansonetti

Aparently the "MacRuby 0.2.pkg" needs Leopard, i'm running 10.4.11.

installing it thru svn + compil could work on a PPC G5 ???

No it won't, MacRuby will only run on Mac OS X 10.5, or later. Tiger
is not supported.

Laurent
 
G

Gregory Seidman

Hi,

After 3 months of development, here comes the second release of
MacRuby, 0.2! Check it out while it's still hot!

MacRuby is a version of Ruby 1.9, ported to run directly on top of Mac
OS X core technologies such as the Objective-C common runtime and
garbage collector, and the CoreFoundation framework. While still a
work in progress, it is the goal of MacRuby to enable the creation of
full-fledged Mac OS X applications which do not sacrifice performance
in order to enjoy the benefits of using Ruby.
[...]

I realize this is a long shot, but I was wondering if there was any chance
that MacRuby could become available on the iPhone. I see two possible
technical difficulties and one possible political difficulty:

- Since ObjC on iPhone does not support garbage collection, there may be
additional work to make the Ruby GC manage things with release/retain.

- Since the iPhone is battery-based, performance matters in terms of
wattage, and a Ruby interpreter may be too inefficient for mobile use.

- Politically, since Apple expressly does not want interpreted code
downloaded from elsewhere and run on the device (e.g. Flash, Java, or
really anything other than JavaScript running in a web component),
providing a language interpreter may appear to run against that interest.

I'm sure you, as an Apple employee, can't comment on the political issue or
the likelihood of MacRuby becoming available in the iPhone SDK (i.e. future
products). If you could comment on the two technical issues, though, I'd
appreciate it. Also, if you weren't thinking in terms of getting MacRuby on
the iPhone, please do; I'm working on an iPhone app now and Ruby would have
been a nice way to go about it.
Enjoy,
Laurent
--Greg
 
J

John Joyce

Hi,

After 3 months of development, here comes the second release of
MacRuby, 0.2! Check it out while it's still hot!

MacRuby is a version of Ruby 1.9, ported to run directly on top of
Mac
OS X core technologies such as the Objective-C common runtime and
garbage collector, and the CoreFoundation framework. While still a
work in progress, it is the goal of MacRuby to enable the creation of
full-fledged Mac OS X applications which do not sacrifice performance
in order to enjoy the benefits of using Ruby.
[...]

I realize this is a long shot, but I was wondering if there was any
chance
that MacRuby could become available on the iPhone. I see two possible
technical difficulties and one possible political difficulty:

- Since ObjC on iPhone does not support garbage collection, there
may be
additional work to make the Ruby GC manage things with release/
retain.

- Since the iPhone is battery-based, performance matters in terms of
wattage, and a Ruby interpreter may be too inefficient for mobile
use.

- Politically, since Apple expressly does not want interpreted code
downloaded from elsewhere and run on the device (e.g. Flash, Java, or
really anything other than JavaScript running in a web component),
providing a language interpreter may appear to run against that
interest.

I'm sure you, as an Apple employee, can't comment on the political
issue or
the likelihood of MacRuby becoming available in the iPhone SDK (i.e.
future
products). If you could comment on the two technical issues, though,
I'd
appreciate it. Also, if you weren't thinking in terms of getting
MacRuby on
the iPhone, please do; I'm working on an iPhone app now and Ruby
would have
been a nice way to go about it.
Enjoy,
Laurent
--Greg
Greg, GC is not that big of a deal. The reference counting mechanism
of Objective-C is super easy. If you follow the rules, you'll be fine.
In most cases, if you use an init method to instantiate, go down to
your dealloc method and use a release.
If your app crashes and the debugger gives you nothing but register
numbers, you need a retain on an object somewhere, to keep it around
long enough to do something with it.

It's not tough at all.
google for Uli Kusterer's site and you'll find his invaluable advice
on retain/release.
It's pretty darn easy.
 
G

Gregory Seidman

Hi,

After 3 months of development, here comes the second release of
MacRuby, 0.2! Check it out while it's still hot!

MacRuby is a version of Ruby 1.9, ported to run directly on top of Mac
OS X core technologies such as the Objective-C common runtime and
garbage collector, and the CoreFoundation framework. While still a work
in progress, it is the goal of MacRuby to enable the creation of
full-fledged Mac OS X applications which do not sacrifice performance
in order to enjoy the benefits of using Ruby.
[...]

I realize this is a long shot, but I was wondering if there was any
chance that MacRuby could become available on the iPhone. I see two
possible technical difficulties and one possible political difficulty:

- Since ObjC on iPhone does not support garbage collection, there may be
additional work to make the Ruby GC manage things with release/ retain.

- Since the iPhone is battery-based, performance matters in terms of
wattage, and a Ruby interpreter may be too inefficient for mobile use.

- Politically, since Apple expressly does not want interpreted code
downloaded from elsewhere and run on the device (e.g. Flash, Java, or
really anything other than JavaScript running in a web component),
providing a language interpreter may appear to run against that
interest.

I'm sure you, as an Apple employee, can't comment on the political
issue or the likelihood of MacRuby becoming available in the iPhone SDK
(i.e. future products). If you could comment on the two technical
issues, though, I'd appreciate it. Also, if you weren't thinking in
terms of getting MacRuby on the iPhone, please do; I'm working on an
iPhone app now and Ruby would have been a nice way to go about it.
Enjoy,
Laurent
--Greg
Greg, GC is not that big of a deal. The reference counting mechanism of
Objective-C is super easy. If you follow the rules, you'll be fine. In
most cases, if you use an init method to instantiate, go down to your
dealloc method and use a release. If your app crashes and the debugger
gives you nothing but register numbers, you need a retain on an object
somewhere, to keep it around long enough to do something with it.

It's not tough at all. google for Uli Kusterer's site and you'll find his
invaluable advice on retain/release. It's pretty darn easy.

Ah, I think you misunderstood what I was talking about. ObjC on Leopard
does GC rather than retain/release. I haven't looked at the implementation
of MacRuby (I know, I should), but if I were writing it I would simply use
the ObjC runtime's GC for Ruby's GC. It's worth noting that MacRuby only
runs on Leopard, no earlier version, and that could be part of the reason.

As for dealing with retain/release in ObjC on the iPhone, I'm not having
any trouble. The main reasons I'd like to use Ruby on the iPhone have
nothing to do with GC. It's how easy Ruby makes DB access (we're using
SQLite, which isn't bad but it's easier in Ruby), collection iteration (I
miss map and inject), and regular expressions (ObjC wrappers for pcre or
POSIX regexes don't cut it).

--Greg
 
J

John Joyce

On Sat, Jun 07, 2008 at 09:47:12AM +0900, Laurent Sansonetti wrote:
Hi,

After 3 months of development, here comes the second release of
MacRuby, 0.2! Check it out while it's still hot!

MacRuby is a version of Ruby 1.9, ported to run directly on top
of Mac
OS X core technologies such as the Objective-C common runtime and
garbage collector, and the CoreFoundation framework. While still
a work
in progress, it is the goal of MacRuby to enable the creation of
full-fledged Mac OS X applications which do not sacrifice
performance
in order to enjoy the benefits of using Ruby.
[...]

I realize this is a long shot, but I was wondering if there was any
chance that MacRuby could become available on the iPhone. I see two
possible technical difficulties and one possible political
difficulty:

- Since ObjC on iPhone does not support garbage collection, there
may be
additional work to make the Ruby GC manage things with release/
retain.

- Since the iPhone is battery-based, performance matters in terms of
wattage, and a Ruby interpreter may be too inefficient for
mobile use.

- Politically, since Apple expressly does not want interpreted code
downloaded from elsewhere and run on the device (e.g. Flash,
Java, or
really anything other than JavaScript running in a web component),
providing a language interpreter may appear to run against that
interest.

I'm sure you, as an Apple employee, can't comment on the political
issue or the likelihood of MacRuby becoming available in the
iPhone SDK
(i.e. future products). If you could comment on the two technical
issues, though, I'd appreciate it. Also, if you weren't thinking in
terms of getting MacRuby on the iPhone, please do; I'm working on
an
iPhone app now and Ruby would have been a nice way to go about it.

Enjoy,
Laurent
--Greg
Greg, GC is not that big of a deal. The reference counting
mechanism of
Objective-C is super easy. If you follow the rules, you'll be fine.
In
most cases, if you use an init method to instantiate, go down to your
dealloc method and use a release. If your app crashes and the
debugger
gives you nothing but register numbers, you need a retain on an
object
somewhere, to keep it around long enough to do something with it.

It's not tough at all. google for Uli Kusterer's site and you'll
find his
invaluable advice on retain/release. It's pretty darn easy.

Ah, I think you misunderstood what I was talking about. ObjC on
Leopard
does GC rather than retain/release. I haven't looked at the
implementation
of MacRuby (I know, I should), but if I were writing it I would
simply use
the ObjC runtime's GC for Ruby's GC. It's worth noting that MacRuby
only
runs on Leopard, no earlier version, and that could be part of the
reason.

As for dealing with retain/release in ObjC on the iPhone, I'm not
having
any trouble. The main reasons I'd like to use Ruby on the iPhone have
nothing to do with GC. It's how easy Ruby makes DB access (we're using
SQLite, which isn't bad but it's easier in Ruby), collection
iteration (I
miss map and inject), and regular expressions (ObjC wrappers for
pcre or
POSIX regexes don't cut it).

--Greg
Well, we'll see soon enough. The NDA period on the iPhone SDK will
probably come to a close soon. The wwdc is this week, so we're bound
to hear more, and there will probably be an update to the SDK too.
As for GC on the phone, there's no reason it couldn't do it.
It does run OS X...
MacRuby is going to be where it's at eventually. It is tied to the
Leopard frameworks, and it is exactly why you won't likely see it
backported. Also, OS X development should be on a faster cycle now,
but in what areas, that remains to be seen.
I would anticipate something of an eventual convergence of most of the
technologies between the iPhone and the full blown computers. Luckily,
the frameworks are pretty consistent about implementations other than
the audio and graphics frameworks....
MacRuby holds great promise. Other than its somewhat awkward looking
method signatures (to make it fit Obj-C methods) the ability to use
Ruby iteration is going to be wonderful and to be able to do it with
very little performance hit...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

[ANN] MacRuby 0.10 0
[ANN] MacRuby 0.5 6
[ANN] MacRuby 0.4 16
[ANN] MacRuby 0.3 2
[ANN] MacRuby 0.6 2
[ANN] MacRuby 13
[ANN] MacRuby 0.9 3
[ANN] MacRuby 0.1 1

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top