[MUD-Dev] Fw: 16K mud server competition !

Richard Woolcock KaVir at dial.pipex.com
Tue Apr 11 21:05:28 CEST 2000


Spin wrote:
> 
> On Mon, Apr 10, 2000, Derek Snider wrote:
> <snipped>
> > What's the smallest size that anyone's been able to get MUD networking
> > code down to? (Written in C or C++)  Does it include buffered input/output?
> > Full error checking?   ...just curious...  I feel that the networking code
> > is going to take up around 4K of valuable space... unless I'm way off.
> 
>   Useless mud (posted in r.g.m.a) includes buffered output, full error
> checking(and reporting, possibly 150 bytes in strings) but no characters
> (connections are identified by their file descriptor). It supports three
> commands close(closes the server),quit and help. Anything that isn't a
> command is echoed to every connection except for the originator. Using
> Erwin's supplied count program this comes out to 6346 bytes before
> optimizing, 3603 afterwards, though perhaps I could have saved a few more
> bytes with globals...and it is nearly as hard to read as raw assembler.

I went for readability over error checking.  Approximately 12k bytes of 
socket code, half that after going through Erwin's count program.  I'm 
trying to create a pure PK mud - but I've already hit the size limit and 
I've not even added combat yet!  I've already started chopping down the
variable names (although I'm determined to keep them hungarianised if 
possible).

Maybe I should have used Perl (which I've just started learning), although...

>   Implementing the same thing in Python, which I've never used before, nor
> have I used a full OO language, took 3284 bytes without any optimization
> at all (there are some really big variable names in there). I've since
> rewritten it and it is probably a little over half the size it was.
>   Even more tempting is a simple implementation of Python's forking TCP
> server class which just echos back whatever it recieves, just 516 bytes.
> Tie that into some shared memory/files and you could easily have a server
> in under 1K (with little error checking).

...high level languages will be competing against each other.  As a (mostly)
low level developer I may as well take part in the style of programming I'm
best at.

KaVir.



_______________________________________________
MUD-Dev mailing list
MUD-Dev at kanga.nu
http://www.kanga.nu/lists/listinfo/mud-dev



More information about the mud-dev-archive mailing list