LuaJIT 2.0 Final ReleasedPosted: November 13, 2012
If you cruise on over to the LuaJIT website: http://wiki.luajit.org You can see the announcement of the LuaJIT compiler finally going to version 2.0.
I must say, watching the evolution of this ‘compiler’ has been quite an eye opener for me. The Lua language itself has been under continuous development for quite a few years. LuaJIT is a different beast though. LuaJIT constrains itself to being ABI compatible with the Lua 5.1 language, while providing a JIT compiler, which is on par with many a standard C compiler. More amazing to me is this is an effort by a singular individual, Mike Pall. Of course there is a community that supports his efforts by trying out his compiler, reporting bugs, discussing best practices, and the like, but the primary coding is being done by one guy. This guy is very smart indeed, and has mad programming skills far beyond anything I’ll ever understand in my career.
There’s one more thing that I find fascinating about this language. Lua supports coroutines natively. Co-routines are a poor man’s version of multi-threading. Basically cooperative multi-tasking, same as what existed in Windows 1.0 back in the day. The difference here though is that low level frameworks can use the feature, so the upper level consumer doesn’t really deal with it that much. Some fairly serious systems have been created using this little feature. One that I’m most impressed with at the moment is OpenResty. This is an app-server based on Nginx, which incorporates Lua and co-routines deep into its bowels. Haven’t heard of it? Well, OpenResty was originally created to handle the webload of TaoBao, which recently set an online sales record. We’re talking online services that are handling hundreds of millions of transactions, and nary a hiccup. I don’t know if Taobao is still using an openresty framework, but it seems to bode well for anyone who wants to go down this path.
Programming systems is really hard. Getting multi-threading is really challenging. As a software engineer, I need a toolset that allows me to quickly prototype variations on themes, try new approaches, and just fiddle about, trying different APIs that are provided by my underlying platform. Rather than getting tied down by a particular language and environment, I have found that LuaJIT gives me a tool which allows me to interact with all environments, frameworks, and hardware devices. When an approach gets baked, I can then look around and see if the platform supports a better/faster, more efficient way of implementing what I’m doing.