- Portals
- The Current Year
- ED in the News
- Admins
- Help ED Rebuild
- Archive
- ED Bookmarklet
- Donate Bitcoin
Contact an admin on Discord or EDF if you want an account. Also fuck bots.
MUMPS: Difference between revisions
imported>Bugbear added a couple of quotes |
imported>Vermin problem solved |
||
(10 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
{{ | {{work|lulz}} | ||
The '''Massachusetts General Hospital Utility Multi-Programming System''', abbreviated as '''MUMPS''' or just '''M''', is a programming language that is absolutely [[Special|unique]] in its [[Shit|shittiness]]. Unfortunately, although it's constructed as one of those shit esoteric languages like [[Brainfuck]] or Befunge, people actually use it. | The '''Massachusetts General Hospital Utility Multi-Programming System''', abbreviated as '''MUMPS''' or just '''M''', is a programming language that is absolutely [[Special|unique]] in its [[Shit|shittiness]]. Unfortunately, although it's constructed as one of those shit esoteric languages like [[Brainfuck]] or Befunge, people actually use it. | ||
{{quote|The primary design goal [of] MUMPS was to create code that, once written, can never be maintained by anyone ever again. [...] A more apt name for the language certainly would have been EXPLOSIVE-DIARRHEA.|Alex Papadimoulis, writing for [http://thedailywtf.com/Articles/A_Case_of_the_MUMPS.aspx The Daily WTF]}} | |||
{{quote|The primary design goal MUMPS was to create code that, once written, can never be maintained by anyone ever again. [...] A more apt name for the language certainly would have been EXPLOSIVE-DIARRHEA.|Alex Papadimoulis, writing for [http://thedailywtf.com/Articles/A_Case_of_the_MUMPS.aspx The Daily WTF]}} | |||
== Code samples == | == Code samples == | ||
A Hello World program in MUMPS looks like this: | |||
<pre style="margin-right:190px;"> | <pre style="margin-right:190px;"> | ||
hello() | hello() | ||
Line 18: | Line 14: | ||
</pre> | </pre> | ||
As TOW explains, the <code>,!</code> part creates a newline for reasons that are [[WTF|totally obvious]]. The <code>quit</code> part is necessary because the MUMPS compiler doesn't give a fuck about whether or not you want a routine to end. This is also painfully apparent in the very short routine size limit. | As TOW explains, the <code>,!</code> part creates a newline for reasons that are [[WTF|totally obvious]]. The <code>quit</code> part is necessary because the MUMPS compiler doesn't give a fuck about whether or not you want a routine to end. This is also painfully apparent in the very short routine size limit, which forces most MUMPS programs to consist of a bunch of routines like <code>ASDF1</code>, <code>ASDF2</code>, and <code>ASDF3</code>, all chained together with <code>GOTO</code> statements. | ||
Alternative version: | Alternative version: | ||
Line 29: | Line 25: | ||
f p=2,3:2 s q=1 x "f f=3:2 q:f*f>p!'q s q=p#f" w:q p,?$x\8+1*8 | f p=2,3:2 s q=1 x "f f=3:2 q:f*f>p!'q s q=p#f" w:q p,?$x\8+1*8 | ||
</pre> | </pre> | ||
== Language design == | |||
{{quote|M is a lousy language with one great data type.|Steve J. Morris, as quoted in the [http://www.faqs.org/faqs/m-technology-faq/part1/ MUMPS FAQ, part 1]}} | |||
The data type he's talking about is the string, which is the ONLY data type in MUMPS. That's right: strings are implicitly converted into numbers while performing mathematical operations. | |||
Speaking of mathematical operations, unlike every other language on the planet, MUMPS evaluates everything left to right. So, in the world of MUMPS, 2 + 3 * 10 is equal to 5 * 10, not 2 + 30. | |||
Other fun things include the keywords. MUMPS doesn't have any. So this shit: | |||
<pre style="margin-right:190px;"> | |||
GREPTHIS() | |||
NEW SET,NEW,THEN,IF,KILL,QUIT SET IF="KILL",SET="11",KILL="l1",QUIT="RETURN",THEN="KILL" | |||
IF IF=THEN DO THEN | |||
QUIT:$QUIT QUIT QUIT ; (quit) | |||
THEN IF IF,SET&KILL SET SET=SET+KILL QUIT | |||
</pre> | |||
is perfectly valid MUMPS code. But wait! There's more! We haven't even talked about ''multi-threading and networking'' yet. Yes, this steaming puddle of afterbirth does indeed support those features. To access a database (or, an array - in MUMPS, they're the exact same thing, but databases have a ^ in front) on another machine, all you need to do is: | |||
<pre style="margin-right:190px"> | |||
SET ^|"DENVER"|A(1000)="Foo" | |||
</pre> | |||
to set the 1000th element of the database A on the machine named DENVER to "Foo". | |||
== External links == | == External links == | ||
Line 35: | Line 53: | ||
* [http://www.faqs.org/faqs/m-technology-faq/ The MUMPS FAQ] | * [http://www.faqs.org/faqs/m-technology-faq/ The MUMPS FAQ] | ||
[[ | |||
[[ | {{softwarez}} | ||
[[ | {{programming}} | ||
[[Category:Programming]] | |||
[[Category:Softwarez]] | |||
[[Category:Internets Phenomena]] |
Latest revision as of 04:36, 15 September 2014
This page has potential but it needs a lot of work. It could benefit from lulz. Discuss edits that might add to the lulz on this article's talk page. |
The Massachusetts General Hospital Utility Multi-Programming System, abbreviated as MUMPS or just M, is a programming language that is absolutely unique in its shittiness. Unfortunately, although it's constructed as one of those shit esoteric languages like Brainfuck or Befunge, people actually use it.
—Alex Papadimoulis, writing for The Daily WTF |
Code samples
A Hello World program in MUMPS looks like this:
hello() write "Hello, World!",! quit
As TOW explains, the ,!
part creates a newline for reasons that are totally obvious. The quit
part is necessary because the MUMPS compiler doesn't give a fuck about whether or not you want a routine to end. This is also painfully apparent in the very short routine size limit, which forces most MUMPS programs to consist of a bunch of routines like ASDF1
, ASDF2
, and ASDF3
, all chained together with GOTO
statements.
Alternative version:
hello() w "Hello, World!",! q
This last program takes advantage of the fact that you can abbreviate keywords like if
in one letter, like i
. So does this one, which prints out a beautifully formatted table of prime numbers:
f p=2,3:2 s q=1 x "f f=3:2 q:f*f>p!'q s q=p#f" w:q p,?$x\8+1*8
Language design
—Steve J. Morris, as quoted in the MUMPS FAQ, part 1 |
The data type he's talking about is the string, which is the ONLY data type in MUMPS. That's right: strings are implicitly converted into numbers while performing mathematical operations.
Speaking of mathematical operations, unlike every other language on the planet, MUMPS evaluates everything left to right. So, in the world of MUMPS, 2 + 3 * 10 is equal to 5 * 10, not 2 + 30.
Other fun things include the keywords. MUMPS doesn't have any. So this shit:
GREPTHIS() NEW SET,NEW,THEN,IF,KILL,QUIT SET IF="KILL",SET="11",KILL="l1",QUIT="RETURN",THEN="KILL" IF IF=THEN DO THEN QUIT:$QUIT QUIT QUIT ; (quit) THEN IF IF,SET&KILL SET SET=SET+KILL QUIT
is perfectly valid MUMPS code. But wait! There's more! We haven't even talked about multi-threading and networking yet. Yes, this steaming puddle of afterbirth does indeed support those features. To access a database (or, an array - in MUMPS, they're the exact same thing, but databases have a ^ in front) on another machine, all you need to do is:
SET ^|"DENVER"|A(1000)="Foo"
to set the 1000th element of the database A on the machine named DENVER to "Foo".
External links
MUMPS is part of a series on Visit the Softwarez Portal for complete coverage. |
MUMPS is part of a series on Programming. [Enter the Matrix] | |
ADA • Assembly • C • C++ • COBOL • Debug • DOS • Erlang • Error • Fdisk • Fortran • Integer • Java • LOLCode • Machine Code • Matlab • MIRC Script • MUMPS • Open Source • Perl • PHP • Programming language • Python • QBASIC • Ruby on Rails • Scratch • SSH • Visual Basic
Firefox XPS IRC Attack • Safari XPS Attack • Sandworm
Bill Gates • Linus Torvalds • Weev • Goatse Security • Terry Davis • Theo de Raadt
Operating system • Warez • Notepad • Is not a bug, it's a feature • Database Error |