lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I think Lua is well suited for a server application. Using the same language for the interface with your clients and for the server processing will remove the need to create and debug interfaces between Lua and Python.

To answer your question you could probably use the stock Lua interpreter on your server, but you could also adapt the Lua interpreter to suit your specific needs (for example to make it run as a daemon, as a cgi script, whatever else). The interpreter source is very small and easy to modify, since it's just a few calls to the Lua API. In both cases you will probably need some binary library for Lua (LuaSocket for example), so building Lua itself is not much more complicated.

Also keep in mind that Lua 5.0 has been released a long time ago, and it's distributed in many Linux distros, so if you don't need specific feature from lua 5.1.x you can probably assume some Lua interpreter is available on your target platform.

My 2 cents :)

Jérôme.

-----Message d'origine-----
De : lua-bounces@bazar2.conectiva.com.br [mailto:lua-bounces@bazar2.conectiva.com.br] De la part de Thomas Blom
Envoyé : 17 août 2006 13:54
À : lua@bazar2.conectiva.com.br
Objet : lua/luasql/mysql for db server vs. modpython/mysqldb etc...

Hello,

I'm an indy game developer using Lua for the first time to script portions of my C++ app.  It's very cool.

I'm now wondering if I might use Lua on the server-side to do mysql queries & pass relatively low-frequency & latency-tolerant data to instances of the client app running on the player machines.  I write for advice as my experience is primarily win32 c/c++.

The game architecture calls for a publicly available server which can accept connections to receive and transmit data to clients - the client app being written in a combination of portable c/c++ and lua.

Having little experience with Linux server development/deployment, I assume the following two options as primary, with the goal of implementing as much server code in as high level a language as possible (read Lua, Python, etc), while still giving good performance:

1. Linux server runs modpython, and server "app" is written in python, making use of mySQLdb or equivalent.  Client app network IO handled by Lua using luasocket.  I know modpython is quite common, and so this seems a good option if the server app is to be easily deployed on servers that I don't completely control (even if just for testing).

2. I lease or maintain a dedicated linux server, on which I install LUA, and write the server app in Lua, making use of luasocket and luasql or equivalent.  Client network IO handled as in (1).  (Will I need to write a C app, embed lua, or can I write the whole app in Lua?)


After exploring various languages, I chose Lua to go with on the client side for a number of reasons, including primarily it's small footprint & this intelligent community with great S/N ratio.  I'd rather stay with Lua on the client (than go to Python).

My intuition is that Python is perhaps a more straightforward solution on the server side; am not sure the ease with which I can deploy a Lua server app on a linux server as described in (2).

All advice appreciated.  Thanks!

-thomas blom in austin, tx