I was having lunch with a friend last week and he mentioned to me that 40% of Adobe’s new Lightroom product is written in Lua, which I had previously heard of because it’s the language used to write World of Warcraft addons. Lua is a scripting language that was designed to extend applications. It’s interesting to see it suddenly take off. Lightroom project founder Mark Hamburg explains why Adobe selected it:
Lua has an appealing balance of simplicity and power. It’s small, fast, and easy to embed. It also has a very straightforward license associated with it. It’s very much like Scheme language I like—but without a syntax likely to make people go running for the hills. So there were a lot of things.
So what we do with Lua is essentially all of the application logic from running the UI to managing what we actually do in the database. Pretty much every piece of code in the app that could be described as making decisions or implementing features is in Lua until you get down to the raw processing, which is in C++. The database engine is in C; the interface to the OS is in C++ and Objective C as appropriate to platform. But most of the actually interesting material in the app beyond the core database code (which is SQLite) and the raw processing code (which is essentially Adobe Camera Raw) is all in Lua.
It’s a wonderful thing that big time software companies like Blizzard (creators of World of Warcraft) and Adobe adopted an existing, open source scripting language for this task rather than going with something proprietary.
World of Warcraft has been out for a couple of years now, and watching the evolution of the addon community has been interesting. It started out as a bunch of gamers just hacking out some code, but these days there are frameworks for writing addons, and projects that use IRC to coordinate, version control, wikis, and all of the other tools you’d expect to see with any active open source software development effort.
It strikes me that Lua development could soon be on the verge of taking off. (There’s a big list of applications that embed Lua here.) I’ll be interested to see if Lua is adopted further within Adobe, as well as which other applications come to be built using Lua. I think learning Lua may be one of my next projects.
I’m also interested in the larger trend of applications that are written on a compiled platform but are built mostly of scripts. Civilization IV was built in this way, but it uses Python instead of Lua for scripting. The talk these days is all about Web applications replacing desktop applications, but desktop applications can still offer many features that are just a dream when it comes to Web development. This integration of scripting platforms into desktop applications strikes me as a way to enable developers of desktop applications to harness some of the development advantages available to Web developers.