| Message |
No, to introduce Lua you wouldn't have to redo everything at all. You'd need to redo the entrance points of the script, and figure out a way to bridge to the if-checks and so forth. That would be the hardest part.
But if I were to do something for my MUD, it wouldn't be easy to port to stock SMAUG(FUSS) because the data structures by this point are quite different (it's C++, for one). I mean, it wouldn't be impossible, but for inexperienced coders looking for a plug'n'play solution, it wouldn't be at all appropriate.
The reason the mudprog language isn't good is because the whole thing is a hack. Even all this work you've done isn't right yet. Does it handle multiple sets of parentheses? Nested parentheses? Have you implemented functions? Do you have proper control flow? Can you make function calls inside function calls that use player attributes? Can you do all of this with functions of several arguments? Can you construct expressions, e.g. boolean expressions, of arbitrary complexity? Do you have any kind of type checking, script variables, and so forth? Do you have complete (or even very high) confidence that what you wrote will work in all cases it claims to cover?
Sure, mudprog "gets the job done" (usually), but the fact that you've had to make all these changes should raise a red flag. And you're still a very far ways away from a proper language that lets you express more or less arbitrary constructs. I just don't see the point anymore of spending so much effort on mudprog, when the whole thing is built on a hack and it flies in the face of any kind of good compiler practice.
See, mudprog becomes so hackish that the code becomes very hard to read and understand. It's built by people who (no offense) didn't really know much about compilers and so did what they could and got something that seems to work. But there are much simpler ways of achieving their goals, if you know something about compilers. The resulting code is much cleaner and easier to maintain. I look at your code and it's nearly incomprehensible; I have to stop and look at it for a long time before it starts making sense. It shouldn't be that way; especially given how easy this problem should have been, that's a sign that the code is dangerously complex.
But hey, if you're happy with it and it serves your purposes, more power to you. I'm just trying to share the benefit of my experience over the years. The short version of what I'm trying to say is:
You (or anybody developing their own scripting system, as I was a few years ago) will spend more time developing your home-grown, very likely to be inferior solution, than you would embedding a tested and supported 3rd-party scripting language, which would give you a considerably superior solution anyhow.
YMMV, of course. |
David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone
http://david.the-haleys.org | top |
|