Ruby/Python/REXX as a MUCK scripting language

i ppgoogle at tberg.net
Sun Nov 26 08:32:01 EST 2006


Tony Belding skrev:

> I'm interested in using an off-the-shelf interpreted language as a
> user-accessible scripting language for a MUCK.  I'm just not sure if I
> can find one that does everything I need.  The MUCK must be able to
> call the interpreter and execute scripts with it, but the interpreter
> must also be able to call functions in the MUCK code.  And then there's
> the security issue that really worries me. . .  I have to be able to
> limit what the interpreter can execute.  I can't have my users running
> scripts that access the console, access the filesystem or sockets
> directly, or call libraries or other binaries outside the MUCK.
>
> Is this practical?  I'm thinking of Ruby or Python for this, if they
> can meet the requirements.
>
> I might even consider REXX. . .  I remember ARexx from my Amiga days,
> and how great it was for string manipulation and application scripting.
>  However. . .  My immediate target platform, Mac OS X, comes with Ruby
> and Python but not REXX, so that's a disadvantage.
>
> My final option would be to create my own language interpeter where I
> have control over everything that happens.  That is what MUCKs have
> always done in the past.  But the result was always quirky, limited
> languages like MUF (Multi-User Forth) which really turn off a lot of
> coders.  Furthermore, I've never created a language before, and it
> would be a lot of extra work for me.
>
> --
> Tony Belding, Hamilton Texas

Regina REXX har a "restricted mode", but it doesn't allow external
calls so this is probably not a solution for You.  Nevertheless, here
is an excerpt from the manual about that mode:

"2.6.3Regina Restricted Mode
Many language interpreters provide a mechanism where code executed
within that interpreter is
limited to affecting the environment of the interpreter and cannot
change the external environment
in which the interpreter runs.
Restricted mode is used in situations where you need to guarantee that
the author of a Rexx
program is unable to affect the user's environment.
Situations where a restricted mode is applicable include, using Regina
as a database procedural
language, or as a language plug-in for a Web browser.
Features of Regina that are disabled in restricted mode are:
·  LINEOUT, CHAROUT, POPEN, RXFUNCADD BIFs
·  "OPEN WRITE", "OPEN BOTH" subcommands of STREAM BIF
·  The "built-in" environments eg. SYSTEM, CMD or PATH of ADDRESS
command
·  Setting the value of a variable in the external environment with
VALUE BIF.
·  Calling external functions
To run Regina in restricted mode, you can start the Regina interpreter
from the command line with
the '-r' switch, or when using the Rexx SAA API, or-ing RXRESTRICTED to
the CallType
parameter of RexxStart() function."

Thomas Berg




More information about the Python-list mailing list