05.01.2013 Views

Mac OS X Leopard - ARCAism

Mac OS X Leopard - ARCAism

Mac OS X Leopard - ARCAism

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

342<br />

CHAPTER 19 EXTENDING THE POWER OF DARWIN<br />

use the irb command). For <strong>OS</strong> X developers the most important similarity is that they are both<br />

compiled as Cocoa frameworks, which makes them available for Cocoa development as well as<br />

Darwin development. Despite the similarities, Ruby is different from Python most noticeably<br />

semantically but also syntactically.<br />

Because Ruby is a newer language, it seems to have learned to avoid a number of issues and<br />

perhaps shortcomings that Perl and Python have had, while at the same time incorporating new<br />

ideas that weren’t mature when Perl and Python were conceived. On the other hand, because of<br />

its relative newness, Ruby has not been tested as much as Perl or Python and as such may not be<br />

as hardened as them. For example, there are those who think Ruby does not scale (in a performance<br />

sense) as well as Perl or Python.<br />

NOTE Much of the performance talk about Ruby may stem from the fact that nobody has<br />

actually used Ruby on a massively large scale. Ultimately, as a new language evolves, it will be<br />

tested, and in certain areas, it will fail or perform poorly; however, as it grows, those issues will<br />

be resolved. Ruby seems to be hovering around those last performance hurdles, but we won’t<br />

know whether it’s actually there until someone does something with it. Python may be considered<br />

the most scalable scripting language today, but it wasn’t considered that until people<br />

realized just how much it could handle (a large amount of Goggle’s back end allegedly runs on<br />

Python, which one would assume puts the question of Python’s scalability to rest).<br />

We’ll be looking at Ruby, specifically Ruby on Rails, a framework for web development,<br />

later in this book. To learn more about Ruby in general, check out Beginning Ruby by Peter<br />

Cooper (Apress, ISBN: 1590597664). If you are looking for specifics on Developing Ruby<br />

Cocoa applications, documentation is included with the Xcode Tools installation (/Developer/<br />

Documentation/RubyCocoa/).<br />

Installing New Darwin Software<br />

Although scripting is a good solution for simple problems, or new problems, often it’s easier to<br />

just use a program that someone else has already written. Since Unix and related operating systems<br />

(such as Linux) have been around for a very long time and continue to be popular, for many<br />

of the tasks you may want to accomplish, an existing application or program may already be<br />

available. Best of all, many of these programs are available for free and are waiting for you to<br />

install them. Some are available simply by downloading an <strong>OS</strong> X installation package and<br />

installing them like any other <strong>OS</strong> X app (MySQL is a popular database that is available in many<br />

formats, including an official <strong>OS</strong> X installation package), but many more are available either as<br />

a precompiled binary (that is, a ready-to-run program) or more commonly (and often preferably)<br />

as a source package. This gives you some options; you could download the source package, configure<br />

it for your specific needs, and then compile the source code into an application optimized<br />

for your computer. You could try to locate a precompiled binary and install that (and hope that<br />

it works right). Or you could take advantage of either Fink or <strong>Mac</strong>Ports (formally known as<br />

DarwinPorts), which are two systems of finding, installing, and maintaining third-party Darwin<br />

applications. This ultimately boils down to preference, but if you haven’t already formed your<br />

own, we suggest you try things in this order:<br />

1. An official binary release, if available, would be the first choice. This should make<br />

installation trivial and effective and should make for easy upgrades if needed. Additionally,<br />

any other applications that may rely on the application would probably assume the official<br />

release.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!