3 ms·
I first got into Lua when a number of years ago someone (thankfully) pointed me to it to save me writing my own scripting engine for an application. As one of
by MattJ100 16y ago
I first got into Lua when a number of years ago someone (thankfully) pointed me to it to save me writing my own scripting engine for an application.
As one of those people crazily obsessed with pursuing simplicity, I really grew to appreciate Lua's design[1]. I started embedding it into any place I wanted simple extensibility in applications. Gradually I found myself writing more and more and more application code in Lua.
This didn't turn out badly at all - Lua's performance is really very good compared to any alternatives, and development was also much faster. With its easy interfacing with C there wasn't really anywhere I couldn't fit it. Lua being so flexible is probably one reason I really can't put it down now.
A couple of years ago I decided to develop an XMPP server (that's another story...). The choice was essentially between C and Lua, myself not liking Java and things like Python/Ruby being too heavy. In order to get off the ground I decided to write entirely it in Lua, and then port each component to C later. I'm happy to say I've continued to be impressed by Lua, both in its runtime performance and the speed and ease at which we can develop code. I have no plans for the C rewriting anymore - we already compare quite favourably with an equivalent erlang server in benchmarks.
Interestingly the "Why on earth did you choose Lua?" comments I received at the start have significantly died off over time. I'd like to think that people really are dropping the "Lua is only for games." stance - in my opinion this language is drastically under-used.
Also (despite a few inaccuracies) there was a good short talk posted recently about Lua[2]. My main quibbles are for example that Kyle repeats that Lua doesn't have print() built-in. His talk is primarily from the embedding perspective, and when embedding, yes, you have to explicitly pull in the standard libaries - but print() is certainly there, along with various other things. Secondly he claims that Lua does not interface well with Java, yet there are several projects allowing exactly that[3]. There are even a few Lua implementations /in/ Java[4].
[1]: Slides from a talk at Stanford by one of the Lua author's on design decisions made in Lua: http://www.stanford.edu/class/ee380/Abstracts/100310-slides.pdf http://www.stanford.edu/class/ee380/Abstracts/100310-slides....
[2]: http://kylecordes.com/2010/lua-strange-loop http://kylecordes.com/2010/lua-strange-loop
[3]: http://www.keplerproject.org/luajava/ http://www.keplerproject.org/luajava/
[4]: http://lua-users.org/wiki/LuaImplementations http://lua-users.org/wiki/LuaImplementations
- deathflute 16y agoDo you have any references comparing the performance of lua with other scripting languages? Thanks