2010

2009

2007

2006

2005

Programming in Lua

Entry published mar 23 2006

After I read a bit about how great Lua is as an embedded and configuration language I decided to give it a try. I read through a few online tutorials, and I browsed the Lua docs, but I really can’t read books on the computer. So I bought the “Programming in Lua” book by Roberto Ierusalimschy. I’m just a little ways into the book, but I’m impressed by the Lua language. It’s very simple, compact, easy to use, and best of all it’s great for extending existing apps. In fact, while working on Kiwi I wrote a few pieces of code in Objective-C that are bound to change frequently, so much so that I was considering how I could make it pluggable. For example, before a message is displayed it goes through a little bit of preprocessing with regex’s and such. One of the preprocessors pulls out the >’s from the e-mail and replaces the chunk with a <blockquote>…</blockquote>. By doing this it makes it easy for the style of the output to be configured using a WebView and some CSS. However, some people might not want to strip out the >’s, and maybe they want to do some extra processing before the message is displayed. I think the perfect solution for this is going to be Lua and an Objective-C bridge. Things can be easily configured and changed while maintaining it’s simplicity and speed, for now though, I’m going to start with inserting Lua in a few simple places and I’ll see where it takes me :)

← Previous: MailCore Framework  //  Next: Around the Web

comments