Lua for MUD development was Re: [vworld-tech] Modern MUD server
design
Brian Hook
hook_l at pyrogon.com
Tue Apr 26 20:51:53 PDT 2005
A little followup now from my Lua notes.
> As mentioned here before, along with Pike and Lua, it sounds like
> JavaScript is a reasonable language as well (and Ruby and I'm sure
> a couple others, but I don't have experience with those).
I said this back when I thought that I wanted the language to be
embeddable and still have a lot of the core written in C/C++. I've
since changed my mind and have decided that I'd rather have the server
written in a higher level language and only call out to C/C++ when
absolutely necessary.
> Lua does not have user defined types, i.e. there are no "class"
> declarations a la C++, Java or Pike. It's prototype based like
> JavaScript or Self, which means that you "derive" from another
> object by simply copying that object and adding new properties.
...and, this sucks. =)
> it). You never have to declare variables, they're automatically
> created on use, same with properties.
...and, this sucks too.
> Lua is small and very fast, however in many situations Pike is much
> faster.
I would really, really like to use Pike or Obj-C, but their Windows
support is crappy at best.
> Lua has a thriving community
Relatively speaking. It's thriving compared to, say, io or D, but not
nearly as vibrant as Python.
> to embed (although I'm coming around to believing that writing
> everything in the script language and calling to C occasionally is
> preferable).
Oh, hey, I guess I said that a year ago.
> There are many support libraries, however not nearly as much as
> Pike or Python or Ruby. But if you just need SQL and sockets and
> basic things like that, those are all available.
The lack of up to date and somewhat sanctioned support libraries is a
serious issue for me. One of the advantages of using a high level
language is that I don't have to integrate a bunch of low-level
libraries for sockets, database integration, regex, etc. Lua has very
sporadic support for a lot of things, a lot of it third-party from the
Lua folk themselves, and this is a liability.
> The nightmarish side of all this is in my previously mentioned
> article, which is that the following things conspire against
> writing robust code:
>
> - variables do not need to be declared
> - table elements do not need to be declared
> - variables are created on assignment, with default global scope
>
> Minor typos can mask bugs for a long, long time unless you have
> really good code coverage analysis happening.
All of the above really made Lua unfeasible when the code base got
beyond a few thousand lines. Things got REAL rickety, and without a
proper debugger/editor (I use Eclipse + PyDev for Python) it just
wasn't tenable.
So now I'm a Python whore, but I'm still just learning it.
Brian
More information about the vworld-tech
mailing list