Elysium now with Javascript support
One of my early goals for Elysium was that it be an environment that is friendly to scripting. There is usually a balance point between hardcoding features and making them easy to use and creating “parts” that can be assembled into new, previously unimagined, wholes. With Elysium I have tried to follow the maxim: “Make the easy things easy and the hard things possible.”
My original plan had been to include Javascript based scripting support using Leopards Javascript core. But, without bridge support, this turned out to be a problem I had neither the time, nor the inclination, to solve. That’s when Laurent Sansonetti of Apple suggested I try MacRuby. As a long-time Ruby coder the idea of using Ruby was very attractive.
For several releases we have had scripting support using an embedded version of MacRuby. It was a bit of a bumpy ride getting it to work but Laurent put in quite some effort. However MacRuby is still a very young product and I think it’s quite a way from being ready for production use.
With the release of JSCocoa it’s possible to access JavascriptCore which is the Apple supplied Javascript interpreter that comes with Leopard and powers Webkit (and, hence, Safari). It’s pretty good and holds out the promise of being able to use the uber-fast SquirrelFish VM when that becomes available. With Elysium being very much a CPU bound application that’s quite an attractive proposition.
The latest release, version 0.9.2, swaps out MacRuby for JSCocoa. In the process the size of the application has shrunk considerably because I’m no longer bundling the MacRuby distribution. And we’ve also got back support for the PPC platform which has suspended because MacRuby is not supported on that architecture.
I’m a little sad not to be using MacRuby. All things considered I’d rather be writing Ruby than Javascript. And I’m grateful to Laurent for the work he did in trying to make MacRuby work for Elysium. But, overall, I think JSCocoa is a better choice for Elysium right now. I’ll take another look at supporting MacRuby when it gets closer to 1.0.
Expect the Elysium scripting guide soon.
Posted by Matt on Sunday, January 11, 2009