MUMPS is a high performance transaction processing key–value database with integrated programming language. MUMPS allows multiple commands to appear on a line, grouped into procedures (subroutines) in a fashion similar to most structured programming systems. Storing variables in the database (and on other machines on the network) is designed to be simple, requiring no libraries and using the same commands and operators used for working with variables in RAM as with data in persistent storage.
History
There have been several revisions to the MUMPS language standard between 1975 and 1999. The ANSI committee has issued standards in 1977, 1980, 1984, 1990, and 1995. The basic language structure has remained constant. MUMPS was early used for multi-user and multi-tasking work. Today, a PC running MUMPS can behave much as a large minicomputer of former years. Early versions of MUMPS did not require large memory or disk capacities and so were practical on smaller machines than some other systems required.
Whitespace
In MUMPSsyntax, some spaces are significant; they are not merely whitespace. Spaces are used as explicit separators between different syntax elements. For example, a space (called ‘’ls’’ in the formal MUMPS standard) separates a tag on a line from the commands that make up that line. Another example is the single space that separates a command from the arguments of that command (called ’’cs’’ in the formal MUMPS standard). If the argument is empty, the command is considered to be "argumentless" since the space separating the command from its argument is immediately followed by the space(s) separating this command from the next command. This means this a context in which a pair of spaces has a different syntactic significance than a single space. One space separates the command from its argument, and the second space separates this command from the next command.
However, extra spaces may always be added between commands for clarity because in this context the second and more spaces are not syntactically significant, up to the line length limit in an implementation. The end-of-line characters are syntactically significant, as they mark the end of line scope for IF, ELSE, and FOR commands.
In contrast to other languages, carriage returns and linefeeds are not the same as white space; they are terminators of a line. Where some languages have a requirement to put semicolons at the end of commands, MUMPS uses the space or line-terminator to end the command. While other languages have larger ways of grouping commands, such as statements and blocks, MUMPS does not have these, only the line scope. Unlike Fortran and some other languages which had fixed-length lines, lines have variable length up to the limit of the implementation, (at least 200 characters, sometimes several megabytes). There is no explicit way to extend or continue a line, although some coding styles can use an argumentless DO and another dot on the next line.
Routines
A typical M procedure (a "routine" in MUMPS terminology) is analogous to a source file in C (in that the subroutines and functions relevant to a particular task or category are grouped together, for instance) and consists of lines of MUMPS code. Starting a line with a label instead of whitespace creates a tag which can be used as the target of a goto, procedure call or function call (functions return values, procedures do not). The label can be used from outside the parent routine's scope by adding the routine name separated by a caret character