[MUD-Dev] Re: (fwd) [DESIGN] Macro semi-language

J C Lawrence claw at under.engr.sgi.com
Wed Apr 29 17:23:38 New Zealand Standard Time 1998


> From: Richard Woolcock <KaVir at dial.pipex.com> 
> Newsgroups: rec.games.mud.diku,rec.games.mud.admin,alt.mud.programming 
> Subject: [DESIGN] Macro semi-language 
> Date: Sat, 25 Apr 1998 04:22:00 -0700

> Recently I was asked by a friend and fellow implementor if I could
> show her how to code on the mud.  She had used pascal before, but
> never used C, and didn't really seem to have any grasp of the
> language.  In order to try and help her, on wednesday I threw
> together a set of macros to create a sort of pseudo-language.  I
> added a few more features on thursday, and today got the chance to
> show her how it worked.  Although she is still having problems, she
> is finding this macro-based system far easier to use, and I have
> started wondering if it might help a few other coder wannabe's.

A point that should be noted among all the language design flames I've 
noted on r.g.m.*:

  All programming languages, C, C++, COBOL, APL, Lisp, Forth, etc, can
be defined as macros atop machine code.  Complex macros to be sure,
but macros none the less.  Ther is no dishonour in using macros.
There are however desing and maintainability remifications.

  In the case of MUDs this gets particularly interesting with the many 
internal server languages used: LPC, ColdC, MUFF, etc.  Again, in base 
principle these are macro languages based atop a machine language
defined by the server (purely a case of different primitives).  You
have a long and rich history behind you in your macro language.

> Note that this system is designed for Merc, but could be easily
> adepted to most other hard-coded systems.

Essentially you are bolting on a user programming language to a
hard-coded system without gaining any of the benefits of internal
languages such as runtime morphism etc.  <shrug> Its a trade-off.

> The advantages and disadvantages as I see it are as follows:

> * ADVANTAGES: More verbose and robust than direct C coding, as well
> as requiring less actual code to be written.  Compiles down almost
> as efficiently as pure C, and can be mixed and matched.

> * DISADVANTAGES: Excessive macros resulting in poor type checking,
> severe limitations on what you can do, and doesn't really help teach
> the user C.  The hope is that as the user requires more and more
> from the code, they will slowly begin to teach themselves, rather
> being dropped in at the deep end and not knowing how to do anything.

<insert langauge design flame here>

<insert language design advocacy here>

<<ignore both>>

--
J C Lawrence                               Internet: claw at null.net
(Contractor)                               Internet: coder at ibm.net
---------(*)                     Internet: claw at under.engr.sgi.com
...Honourary Member of Clan McFud -- Teamer's Avenging Monolith...

--
MUD-Dev: Advancing an unrealised future.



More information about the MUD-Dev mailing list