[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  SMAUG
. -> [Folder]  SMAUG coding
. . -> [Subject]  Processing Parenthesis Correctly

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?
(New message)
Subject: Processing Parenthesis Correctly
Name:
Your forum user name.
Register forum user name
Password:
Your forum password.
Forgotten password?
Message:
Message to be posted (in English, please).
Forum codes:
Check this if your message uses 'forum codes' or templates (auto-detected for new posts).
Forum codes Templates

Save this message ...


Subject review (reverse sequence)

Pages: 1 2  3  

Posted by David Haley   USA  (3,881 posts)  [Biography] bio   Moderator
Date Tue 16 Jan 2007 09:37 PM (UTC)  quote  ]
Message
That was my plan, yes, to automatically convert everything that can be reasonably converted. I would need to write a small program that parses mudprog and outputs equivalent Lua. Hopefully, all constructs will be convertable; mudprog doesn't do anything terribly complicated.

My hunch at the moment is that I should cross this bridge when I come to it. It might turn out that this is really easy to do; or, it might turn out that it's so complicated that it'd be better to just rewrite things in Lua. The syntax is very similar, after all.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Metsuro   USA  (389 posts)  [Biography] bio
Date Tue 16 Jan 2007 09:25 PM (UTC)  quote  ]
Message
Couldn't you just make something to automatticly change the bulk of the old mess and convert it to the new? Then what really cant be converted give instruction on how to convert it. Or is trying to convert it to much, and wanting to keep things "ease" have to make it read the ifs and all that from the old system...

Everything turns around in the end
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio   Moderator
Date Tue 16 Jan 2007 09:19 PM (UTC)  quote  ]
Message
Oh... no, by backwards compatibility I mean letting old mudprog scripts work in the new version. (Backwards compatibility means that older things (e.g. data) still work in the new version of the program, not that the new one works in older versions.)

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Metsuro   USA  (389 posts)  [Biography] bio
Date Tue 16 Jan 2007 08:49 PM (UTC)  quote  ]
Message
Well normally when one thinks of backwards capabilty you think of having it work with older verison of said thing. I was implying why not just get it working the way you think it should with the stock, and then if it was needed on older ones, to dumb it down to have it work in the older verisons after the orginal is finished? I donno exactly how things work, but thats usually what I think of when I hear backwards capability.

Everything turns around in the end
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio   Moderator
Date Tue 16 Jan 2007 03:23 PM (UTC)  quote  ]
Message
What do you mean? I was hoping to have some kind of system where a SMAUGfuss MUD could be more or less seamlessly moved from the current system to a Lua system. Unfortunately I'm not sure how feasible that is, although it would probably work in most cases. But what do you mean about having it only at first and then dumbing it down later?

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Metsuro   USA  (389 posts)  [Biography] bio
Date Tue 16 Jan 2007 12:58 PM (UTC)  quote  ]
Message
Well Backwards capable could be worried after the first is working then dumbed down later or some such?

Everything turns around in the end
[Go to top] top

Posted by Gohan_TheDragonball   USA  (183 posts)  [Biography] bio
Date Tue 16 Jan 2007 04:41 AM (UTC)  quote  ]
Message
naturally.....(long long stare as his mind is soooo jumbled right now)
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio   Moderator
Date Mon 15 Jan 2007 09:31 PM (UTC)  quote  ]
Message
Well, Lua doesn't allow multi-line strings with the "..." syntax; you need to use [[...]] to span multiple lines. So that would be one complication, yes.

As for mpsleep, the problem is that we need a way to pause the interpreter at that point in the script and resume it later on, while allowing other scripts to be run in the meantime, which means that you can't simple pause the entire interpreter. Lua's natural solution is to use co-routines, which implies that some kind of management is needed to keep track of which ones are running, and which ones need to be resumed, and so forth.

Of course, once you implement a coroutine manager like that, you are so close to having much, much more power available, namely letting users use coroutines to do really powerful stuff like pause until user input is received. The balance I am trying to strike is to support as many powerful features as possible, while at the same keeping the project manageable so that I can implement it in a small amount of time.

The issue of backwards compatibility is also, naturally, rather worrisome.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Metsuro   USA  (389 posts)  [Biography] bio
Date Mon 15 Jan 2007 09:10 PM (UTC)  quote  ]
Message
I though it was a tilde, heh. However you said say would become more like say "String" well in my mud if it went over multiple lines, using it the way it is, would give me say "Line one/ Line two" and that'd give us a nice pretty / in there. And into the Mpsleep thing, wouldn't following how Mpsleep worked work just as well, or I know I've seen Nick argue about this once or twice about the forum's talking about it'd freeze the entire mud or some such?

Everything turns around in the end
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio   Moderator
Date Mon 15 Jan 2007 08:57 PM (UTC)  quote  ]
Message
I was thinking of using the same editor, yes. One problem is that SMAUG uses twiddles to end strings, but Lua uses them for such things as the ~= test. They'd need to be escaped one way or the other.

Lua doesn't really care about line endings, though. So the question of treating several lines as one wouldn't really come up, because the Lua parser takes care of that for you.

One nifty feature would be for the Lua display to have syntax coloring...

As I think about this, I will add more posts discussing the various issues. The main issue I am thinking about is how, if at all, to manage coroutines. E.g., pausing a script while waiting for player input.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Metsuro   USA  (389 posts)  [Biography] bio
Date Mon 15 Jan 2007 08:37 PM (UTC)  quote  ]
Message
If you could add lua to smaugfuss, would it use the same editor or a new one? If it was the same the snippet to allow "/" to make multple lines to be treated as one, would have to be removed right?

Everything turns around in the end
[Go to top] top

Posted by Samson   USA  (683 posts)  [Biography] bio
Date Sat 13 Jan 2007 03:14 AM (UTC)  quote  ]
Message
Yes, SmaugFUSS 1.7 is the most current. The download is kept up to date with the official bugfix posts, so don't let the file date in the downloads area fool you.

And I thank you ahead of time for at least looking into it. If you end up not having time to backport it yourself, you can feel free to offer what you can from your own codebase and I'm sure someone involved with FUSS will be able to help backport it if I end up not having time for that myself.

SmaugMuds.org: http://www.smaugmuds.org - The Smaug MUDs Community Center

"The past was erased, the erasure was forgotten, the lie became truth." -- George Orwell, 1984
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio   Moderator
Date Fri 12 Jan 2007 10:30 PM (UTC)  quote  ]
Message
Samson, is SMAUGfuss 1.7 the most appropriate code for me to work on were I to submit a patch for this Lua stuff?

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio   Moderator
Date Fri 12 Jan 2007 09:33 PM (UTC)  quote  ]
Message
No, like I said, if it works, then great, but sometimes it is better (both in terms of time necessary and quality of end result) to start over than to work on top of a "foul hack". I am convinced that mudprog is one of those cases. That's why I started writing my own scripting system several years ago, but it never got anywhere because (a) I did not at the time have enough background to do it right, and I was lacking a lot of useful features like type checking, and (b) I realized (in part due to e.g. Nick's suggestions) how silly it was to reinvent the wheel when there were perfectly good scripting engines, such as Lua (or Python or Ruby or whatever) that had passed the test of time/usage and (more importantly) were actively maintained and bug-fixed by someone else.

Well, tell you what. I'll give serious thought to adding Lua to the SMAUGfuss codebase, or on my own codebase and hope that somebody can back-port it. I don't know if I'll have time, but I'll see what I can do. I've been thinking of doing it for my own codebase anyhow, and with any luck the bulk of it will be portable. It would probably do the community quite some good, I imagine. Of course, existing mudprogs would have to be rewritten somewhat, e.g. say hello there, how are you would have to become say "hello there, how are you".

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Samson   USA  (683 posts)  [Biography] bio
Date Fri 12 Jan 2007 08:52 PM (UTC)  quote  ]
Message
With all due respect, you aren't likely to find very many people in mudding who do know anything about compilers. Aside from "type make, then pray". I'm going to take a wild guess here and say Gohan probably is one of those who does not know enough about compilers to "do it right", so he's doing the best he can with what's available.

Mudprogs may be a foul hack, but they're a foul hack that works. I see nothing at all wrong with trying to turn it into less of a foul hack and more into something that works. Even if it's messy as hell, builders won't be digging around in the source code and marveling at the huge mess :P

I'm sure there would be plenty of people who would appreciate seeing something shiny, new, modern, and non-hackish. But the vast majority of folks I talk to, and myself included, are not up to the task of converting Smaug or any other codebase to use Lua instead of the prog system. I might be able to take an existing implementation and backport it to the C codebase because I'm familiar enough with how that stuff sticks together but I'm sure there's plenty of folks who can't even do that much because their C/C++ knowledge isn't that far along.

SmaugMuds.org: http://www.smaugmuds.org - The Smaug MUDs Community Center

"The past was erased, the erasure was forgotten, the lie became truth." -- George Orwell, 1984
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


17,107 views.

This is page 1, subject is 3 pages long: 1 2  3  [Next page]

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]