MacOS X 10.5 Leopard, From a Developer’s Perspective

Apple’s eagerly awaited operating system, MacOS X 10.5, also known as “Leopard”, is now in our hands, and there are quite a few features in it that will be interesting to developers. Amazon is still offering Leopard for $20 off list and Leopard Family Pack (5-user license) for $10 off list.

I do limited development on MacOS X. I don’t write Macintosh applications, but I do write web-based applications that I deploy to non-Macintosh servers. The Mac is a great environment for doing this; I get a real UNIX environment under the hood with Apache, MySQL and Perl, and a nice layer of Macintosh over the surface. After years of struggling with Windows and Cygwin, or living with Windows and Linux, it’s been wonderful moving to a single, reasonable environment for working.

Given that, my emphasis on development under Leopard will be on the kinds of tools a web developer might use, rather than XCode, although I’ll touch on XCode at the end.

Perl

Leopard has moved up to Perl 5.8.8, from 5.8.6 which Tiger was using. I do most of my development in Perl, and the upgrade was painless for me from this perspective. I used CPAN after the upgrade to update many of the built-in system Perl modules, but had no problems with Perl modules I’d already installed before. In fact, after updating to Leopard I was able to run my Catalyst-based application without modification. That made this the most painless OS update I’ve ever done.

Ruby

Leopard ships with Ruby on Rails. It includes Ruby, version 1.8.6, although it doesn’t include mod_ruby. Rails is included as a Ruby gem. You can find out more in the FAQ. If you’ve been curious about trying out Ruby on Rails and you’re running Leopard, you’ve got what you need to start.

Python

Leopard includes Python 2.5.1, but not mod_python. It includes many Python add-ons including bindings for Subversion. Leopard also supports Python through its ” Scripting Bridge Support”, which provides a way for Python apps to directly control scriptable MacOS X applications.

X11

X11 is, unfortunately, a mess. I use X11 rather than the Terminal out of force of habit. I don’t really need most of the features of X11 (nor do I need its overhead), but I’ve continued using it. Leopard’s X11 is such a mess that I’ll probably start using Terminal instead.

First, just trying running it. Start Applications | Utilities | X11. It bounces for a long time and eventually opens an xterm and you oddly end up with three X11 icons in the dock, only one of which actually gets you to the app you’re trying to use.

Second, try OPTION-TAB’ing to it. The active window doesn’t come to the front. Apple has fixed this problem at least three times in the past and yet it persists with new releases of X11.

Third, try using it with Spaces. I dare you! It’s completely messed up. It even manages to mess up other apps. I have X11 and Safari running in different spaces; I OPTION-TAB to X11 and its menu bar shows up in Safari’s space. I manually switch to X11’s space and end up with Safari’s menu bar there. Very bad.

Granted that probably very few people really need to use X11 under MacOS X, and that I’m not actually one of them. Still, you’d think that given a working X11 from 10.4, you’d be better served to just stick with it than ship a newer, broken one with 10.5.

There is a workaround to the first problem. Open a Terminal window and run this:

launchctl start org.x.X11

That will start X11 in a way that leaves it interacting better with MacOS X. The bigger workaround seems to be to abandon it unless you have no other choice.

Java

Developer happiness unfortunately goes off the rails when we get to Java. MacOS X 10.5 Leopard currently supports only Java 1.5. Its predecessor, MacOS X 10.4 Tiger, supported Java 1.6, so this is a serious step backwards. Look it as Apple putting its resources where there was the most demand. There are no major applications running on the Mac which require Java 1.6. This will inconvenience some developers, and if you’re one of them you should most likely wait till Apple releases Java 1.6 before you upgrade. Historically, Apple has often released an update to Java soon after a major operating system update, so hopefully the wait won’t be too long.

Subversion

Leopard’s developer tools now include Subversion support out of the box. No more having to build your own or get them through fink. They also include the Apache subversion modules so that you can use Leopard to host a subversion repository without any additional software.

The Subversion binaries in Leopard are version 1.4.4.

Apache

Apple now includes Apache 2.2.6 as the standard web server in Leopard. It includes the standard set of modules, including dav, ssl, perl, php4, as well as svn. If you’ve hacked up your Apache configuration at all or if you’re depending on mod_perl from Apache 1, you’ll almost certainly have a bit of work to do when you upgrade.

MySQL

MySQL isn’t bundled with Leopard client. I run the MySQL server that I downloaded from mysql.com and it survived the upgrade process with no issues that I’ve seen.

XCode

Leopard includes XCode 3.0. Unlike Microsoft Windows, where you can easily drop $2,500 for development software, you’ll find Apple’s developer package included on the Leopard CDROM. XCode is based on a standard UNIX gcc development environment, with a pretty IDE wrapped around it.

The XCode 3.0 now supports code-folding, to collapse code you don’t need to see at the moment; code completion, offering to complete the names of symbols as you’re editing, and in-line error messages (”message bubbles”) showing what’s wrong where. There are also improvements in the debugger and in Objective C 2.0, Apple’s language of choice.

XCode 3.0 includes “Instruments”, which was called “XRay” last year. Instruments takes advantage of the new dtrace utility call in order to provide monitoring and instrumentation of your application while it runs.

You also get “Dashcode”, a Dashboard widget development application which was accidentally leaked by Apple last year.

AppleScript

AppleScript has also been updated in Leopard. According to the AppleScript web site, Applescript now supports Unicode and 64-bit computation. There are quite a few enhancements which help deal with properties of applications (is the application running, what’s version is it, …) as well as better, clearer error messages. More of the OS is now scriptable, and the included “Scripting Bridge” allows Objective C, Javascript, Ruby and Python applications to more easily control scriptable applications. Perl, unfortunately, gets no Scripting Bridge love.

15-year old AppleScript is now AppleScript 2.0.

In Summary…

If you’re doing web development, this is a great platform to be working on. You’ve got Apache, Perl, PHP, Python and Ruby, all working out of the box. You’ve got Subversion for version control, and real UNIX under the hood so that you’re not fighting against Windows all the time.

If you’re looking for a copy of Leopard, check it out on Amazon; they’ve got the best price I’ve seen for it.

[tags]macintosh, leopard, macos x, 10.5, perl, ruby, subversion, dtrace, developer, java, python, x11, spaces, applescript[/tags]

| Print This Post Print This Post

One Response to “MacOS X 10.5 Leopard, From a Developer’s Perspective”

  1. has Says:

    “Leopard also supports Python through its ” Scripting Bridge Support”, which provides a way for Python apps to directly control scriptable MacOS X applications.”

    I think you’re confusing Bridge Support - metadata files that make it easier to generate framework bindings for PyObjC, RubyCocoa, etc. - and Scripting Bridge, which is a Cocoa API for sending Apple events from ObjC and other languages with ObjC bindings.

    “the included “Scripting Bridge” allows Objective C, Javascript, Ruby and Python applications to more easily control scriptable applications. Perl, unfortunately, gets no Scripting Bridge love”

    Third-party application scripting support for ObjC, Ruby and Python has been available for a while now and is definitely worth exploring even if you’re on Leopard, e.g. see my sig.

    As for Perl, I haven’t yet tried SB via PerlObjC or CamelBones so I don’t know if that’ll work or not; however, Leopard does include a new version of Mac::Glue that now works under i386 as well as PPC (the version in 10.4 was broken on Intel boxes). Admittedly, Mac::Glue does have a few flaws (though Scripting Bridge isn’t exactly brilliant either from what I’ve seen), but the developer is hoping to make improvements so take a look if you’re a Perl fan.

    HTH

    has

    http://appscript.sourceforge.net
    http://rb-appscript.rubyforge.org

Leave a Reply

You must be logged in to post a comment.

Sponsored Links