Fork me on GitHub

Debriefing on Lua

21 Dec 2008

It’s been a couple of weeks since I last programmed in Lua. I picked Lua up after learning that it’s a prototype-based programming language, not object-oriented as I had assumed at first. At the time, I was running into some problems modeling game objects in Wormbane, a roguelike in Python. Both Steve Yegge and Pär Winzell had recommended prototype-based modeling for game development.

I started yet another roguelike effort, in Lua this time, as you might imagine, and named it Moonshine. The Alien library provided a convenient way of interfacing with Curses. I also constructed a plot involving Christofer Columbus, the Vatican, Vlad Tepes, and the Great Depression, though to this day it really hasn’t come together. Being new to Lua, I found myself missing Python’s builtin utilities. Once I know Lua half as well as I know Python, I may think differently. In the meantime, I figured that implementing the utilities in Lua myself would be a good exercise. The result is the Mimic library. The Python-style import function for Lua is another offspring of Moonshine. It could use some more work. Maybe I will end up merging it into Mimic.

The last problem I ran into before moving on to other projects was how to define property handlers in Lua. I like the way properties work in Python, no surprises there, and was aiming for something similar. I haven’t solved that problem yet. I can’t say that I’ve figured Lua out either, but I know that I like it so far, and I’d like to know it better.

Latest Blog Posts