Message Parsing Interpreter
Encyclopedia
The Message Parsing Interpreter (MPI for short, not to be confused with the Message Passing Interface
Message Passing Interface
Message Passing Interface is a standardized and portable message-passing system designed by a group of researchers from academia and industry to function on a wide variety of parallel computers...

) is a Lisp
Lisp programming language
Lisp is a family of computer programming languages with a long history and a distinctive, fully parenthesized syntax. Originally specified in 1958, Lisp is the second-oldest high-level programming language in widespread use today; only Fortran is older...

-like programming language
Programming language
A programming language is an artificial language designed to communicate instructions to a machine, particularly a computer. Programming languages can be used to create programs that control the behavior of a machine and/or to express algorithms precisely....

 based on text replacement
Text replacement
Text replacement, Replace as you type or AutoCorrect is a function commonly found in word processors such as Microsoft Word. Its principal purpose is as part of the spell checker to correct common spelling or typing errors, saving time for the user...

 that is used on Fuzzball MUCK
Muck
Muck can refer to:*Muck *Muck, Scotland, an island in Scotland*Isle of Muck, a small island connected by sand spit to Portmuck, County Antrim, Northern Ireland*Muck , a number of actions...

 server
Server (computing)
In the context of client-server architecture, a server is a computer program running to serve the requests of other programs, the "clients". Thus, the "server" performs some computational task on behalf of "clients"...

s, starting with version 2.2fb5.00. It is generally considered easier to learn and use than MUF
MUF (programming language)
MUF is a Forth-based programming language used on TinyMUCK MUCK servers and their descendants, including Fuzzball MUCK, ProtoMUCK and GlowMUCK.MUF is the system programming language for TinyMUCK systems...

, and enjoys a large popularity among Fuzzball MUCK users.

Amusingly, MPI originally stood for "My Personal Insanity" — a temporary project name used by the programmer when it was first implemented during a 3 week coding binge. It was later backronym
Backronym
A backronym or bacronym is a phrase constructed purposely, such that an acronym can be formed to a specific desired word. Backronyms may be invented with serious or humorous intent, or may be a type of false or folk etymology....

ed to "Message Parsing Interpreter" to keep the acronym, yet sound more respectable.

When online, the command MPI CATEGORY provides a listing of the available MPI topics arranged by function. The most common use for MPI is for report generation and formatting text strings, however it does support the creation of macros, conditional logic, and looping for a limited number of iterations.

Command Structure

MPI could be viewed as a form of markup language
Markup language
A markup language is a modern system for annotating a text in a way that is syntactically distinguishable from that text. The idea and terminology evolved from the "marking up" of manuscripts, i.e. the revision instructions by editors, traditionally written with a blue pencil on authors' manuscripts...

as instructions are encapsulated within bracket marks to differentiate them from regular text. The MPI command is specified first, followed by a colon, and then command arguments, separated by commas. If one of the arguments is a string that contains a comma, it is escaped by using a backslash or the {lit:} (for literal) command.


{ command : argument1, argument2 }


Commands can be nested, taking the place of one or more arguments within the parent command to form more complex code:


{tell: {name:me} just looked at {name:this}., {owner:this}}

Hello World

The standard "Hello World" program would look like this:


{tell:Hello World, me}

More complex substitution

More complex code in MPI may become difficult to read. Some examples: This sequence informs the user of the next database save:

Next scheduled save will occur at {convsecs:{add:{prop:_sys/dumpinterval,#0},
{prop:_sys/lastdumptime,#0}}}\, being in {ltimestr:{subt:{add:
{prop:_sys/dumpinterval,#0},{prop:_sys/lastdumptime,#0}},{secs}}}


Next, a loop of a fixed range of iterations that generates random text. A property named ascii on the same object would need to be loaded with the ASCII characters from the 32-127:

{null:{store:,launchcode,this},{if:{&arg},{store:{min:60,{max:1,{&arg}}},count,this},
{store:{dice:60},count,this}},{while:{not:{eq:-1,{store:{subt:{prop:count,this},1},count,this}}},
{store:{prop:launchcode,this}{midstr:{prop:ascii,this},{store:{dice:94},tempcharval,this},
{prop:tempcharval,this}},launchcode,this}}}


Combining MPI with the MUCK properties system can allow for a loop with an indefinite number of iterations. One might place this inside a property named delayloop and then {eval} it:

{delay:{prop:seconds,this},{lit:Hello World{null:{if:{awake:me},{eval:{prop:delayloop,this}}}}}}

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK