M[umps]



  • <font size="3">So, I've recently
    signed on with a company that's in the health-care business; our main
    database is built around a system called M[umps].  The deeper I get
    into this ...pile, the more
    colossal it appears.  It's like a giant shrine to WTF-ery.  The sad
    thing is, it's apparently very big in the healthcare world ...

    Has anyone experienced this?  Or worse, are there any M zealots here?

    Just a few examples ...
    </font>

    • <font size="3">Everything is a string.  M (supposedly) "invisibly" handles all the casts and conversions for you.  Mmmmkay .... Sort of like using a Visual Basic Variant for everything.  We all know how brillant that is.</font>
    • <font size="3">By default, all variables are global.  Hmm.  A zillion global Variants.  That's a recipe for success.</font>
    • <font size="3">Since everything is a string, boolean logic gets interesting.  By design, any non-zero value is True.  True/False/FileNotFound/ImHavingABadHairDay ?</font>
    <font size="3">That's enough whining for today.

    </font><font size="3">Just wondering.  Or am I wrong?
    </font>



  • Hmm - it's sort like a strange mix of C and VB. Very, very, good mix.



  • Sometimes some great brains take the best of the better languages and make a new one  (or at least try to do it) this is how Java and now C# were made.

    Sometimes some dumbass may say "If they take the best and make it a success then we can take the worsts things of each language, that's something that never tried before!"

    And you have it.

     

    PS: For the language motivation historers -> I didn't want to be precise on the forces that impulsated the creation of Java and C# on purpouse.

    PSS: historers? does this word even exist?



  • @Taliesin said:

    PS: For the language motivation historers -> I didn't want to be precise on the forces that impulsated the creation of Java and C# on purpouse.

    PSS: historers? does this word even exist?



    no, but "impulsated" definitely does ;-)

    so, to get back on topic, i work for a company that codes in MUMPS's "sister" language, MAGIC.  well, it's a newer version that runs on Windows (instead of being its own OS, wtf?), called MAGICFS.  anyway, it's definitely a WTF.  the whole language.  but they do have local variables...  26 of em.  and 26 globals.  gee, i wonder what the allowed names for those variables could be?  and since all variables are strings, there are "special" functions to deal with floats...  instead of 5.0+4.1 you have to use 5.0~+4.1, but you have to be sure and pad with zeroes so they both have the same amount of decimal places, which means a string concatenation!  and prepending an operator with ~ usually means "not", or "do the opposite"...  so shouldn't that be subtraction?  who knows?  oh man, i could go on all day...  anyway, you should check out the history of all this stuff on wikipedia...  a very interesting and sordid history. 






  • Apparently its best WTFs features are...

    • Fast development time
    • Easy to change your coding
    • Scalability
    • Uses sparse arrays, where data space is not allocated until actually needed
    • Handles integers, floating point or text without having to differentiate between them
    • Only 26 commands support the entire language
    • Variables may be set up on the fly; no need to dimension them at program start
    • Files may be created and indexed on the fly
    • You can code functions on the fly
    • High-level commands are available for interacting with the host OS
    • You can scale data storage up into hundreds of terabytes
    • There's a full compliment of management utilities, including database repair without third-party participation
    • It supports "Post-conditionality", a concept not found in any other language Martin is aware of
    • It can interface with Windows via a broker
    • It can use HL7 (ANSI standards for the exchange, management and integration of electronic healthcare information) to communicate with any other computer in the world
    • It supports string lengths of up to 32767 bytes
    • It supports the construction and use of objects
    • It can create web-based applications, using objects and “server pages”
    • It integrates with other M applications easily and seamlessly



  • @your mom said:

    @Taliesin said:

    PS: For the language motivation historers -> I didn't want to be precise on the forces that impulsated the creation of Java and C# on purpouse.

    PSS: historers? does this word even exist?



    no, but "impulsated" definitely does ;-)

    so, to get back on topic, i work for a company that codes in MUMPS's "sister" language, MAGIC.  well, it's a newer version that runs on Windows (instead of being its own OS, wtf?), called MAGICFS.  anyway, it's definitely a WTF.  the whole language.  but they do have local variables...  26 of em.  and 26 globals.  gee, i wonder what the allowed names for those variables could be?  and since all variables are strings, there are "special" functions to deal with floats...  instead of 5.0+4.1 you have to use 5.0~+4.1, but you have to be sure and pad with zeroes so they both have the same amount of decimal places, which means a string concatenation!  and prepending an operator with ~ usually means "not", or "do the opposite"...  so shouldn't that be subtraction?  who knows?  oh man, i could go on all day...  anyway, you should check out the history of all this stuff on wikipedia...  a very interesting and sordid history. 



    There's a popular web-based back-office system here that's a WTF as far as front-end code goes (fucked HTML, fucked CSS, fucked script). It uses client-side VBscript. Sometimes with the runat="server" attribute.

    I'm certain the backend code is equally horrible.

    The problem is that it works really well and is feature-rich. It gets the job done. So as long as the vendor keeps pumping features into it, the code will never become halfway decent!


  • @your mom said:


    so, to get back on topic, i work for a company that codes in MUMPS's "sister" language, MAGIC. 



    to be more precise, MAGICFS is more like a great-great-grandchild...  it goes from M to MIIS to MAGIC to MAGICFS, and there's a cousin named Client/Server.  anyway, the apple doesn't fall far from the tree.



  • @akrotkov said:

    Hmm - it's sort like a strange mix of C and VB. Very, very, good mix.

    Except that it was designed in 1966, on a PDP-7.

    @your mom said:
    ... anyway, you should check out the history of all this stuff on wikipedia...  a very interesting and sordid history.

    Yeah, I'm becoming quite familiar with it.  My point was more just to get some feedback from people that actually have to use this piece of shit, and have been for a while, to decide if I'm being overly concerned by the WTF-ery...

    Of course, if you stare at the same WTFs day-in and day-out for long enough, they start to make sense.

    I am very, very afraid.



  • @versatilia said:

    http://www.regdeveloper.co.uk/2005/12/23/mumps_m_prgramming/

    Apparently its best WTFs features are...

    • Fast development time
    • Easy to change your coding
    • Scalability
    • Uses sparse arrays, where data space is not allocated until actually needed
    • Handles integers, floating point or text without having to differentiate between them
    • Only 26 commands support the entire language
    • Variables may be set up on the fly; no need to dimension them at program start
    • Files may be created and indexed on the fly
    • You can code functions on the fly
    • High-level commands are available for interacting with the host OS
    • You can scale data storage up into hundreds of terabytes
    • There's a full compliment of management utilities, including database repair without third-party participation
    • It supports "Post-conditionality", a concept not found in any other language Martin is aware of
    • It can interface with Windows via a broker
    • It can use HL7 (ANSI standards for the exchange, management and integration of electronic healthcare information) to communicate with any other computer in the world
    • It supports string lengths of up to 32767 bytes
    • It supports the construction and use of objects
    • It can create web-based applications, using objects and “server pages”
    • It integrates with other M applications easily and seamlessly


    And this is different from VB6 how...?



  • @Albatross said:

    And this is different from VB6 how...?



    trust me, if you coded in MUMPS or MAGIC, you would wish you were lucky enough to get to code in VB...



  • @Albatross said:

    And this is different from VB6 how...?

    Two things that come off the top of my head ...

    VB6 doesn't allow this WTFtype of indirection:
    [code]SET SUBROU="REPORT"
    DO @SUBROU[/code]
    Consider your worst nightmares of C macros, here.

    As I understand it, though I haven't seen a concrete example, yet, M allows you to call a "function" (which M doesn't support in the way we're used to, but that's another WTF) anywhere inside the function that you like ...  To continue the example above:
    [code]S SUBROU="REPORT"
    DO @SUBROU + 69[/code]
    would call the 69th line in the "function" called report...

    Oh, yeah, you can abbreviate things, too.

    My head hurts



  • @John YaYa said:

    @akrotkov said:
    Hmm - it's sort like a strange mix of C and VB. Very, very, good mix.

    Except that it was designed in 1966, on a PDP-7.

    @your mom said:
    ... anyway, you should check out the history of all this stuff on wikipedia...  a very interesting and sordid history.

    Yeah, I'm becoming quite familiar with it.  My point was more just to get some feedback from people that actually have to use this piece of shit, and have been for a while, to decide if I'm being overly concerned by the WTF-ery...

    Of course, if you stare at the same WTFs day-in and day-out for long enough, they start to make sense.

    I am very, very afraid.


    I work for a company that creates HIM application.
    We use PowerBuilder for our Client/Server apps and C# for web aaps.
    While there are plenty of WTFs in the PowerBuilder development environment and it is really really slow, Visual Studio and Sourcesafe also suck, your problems sound 10 times worse than anything I have to deal with over here.



  • MUMPS is brilliant. It's the only known language worse than tcl.



    John YaYa,



    Something essentially like the scary "indirection" you're talking about is of course supported in VB6: Look up CallByName() and AddressOf. There's <font face="Courier New" size="1"></font>also GetRef() in VBS, which is identical.



    I'm assuming that what's bothering you is the string part. Obviously,
    nobody with any actual knowledge of programming would be at all
    bothered by references to functions in and of themselves.





    And the guy who likes MUMPS
    brags that, "Variables may be set up on the fly; no need to dimension
    them at program start" -- umm, that's not a huge advance over anything
    invented after about 1966... Same goes for the rest of the fabulous
    features he names (except maybe for the "post-conditional" thing,
    whatever that is): All programming languages do that stuff. But very few of them bury it under such an enormous steaming pile of shit.



  • @Edgar Plonk said:

    And the guy who likes MUMPS
    brags that, "Variables may be set up on the fly; no need to dimension
    them at program start" -- umm, that's not a huge advance over anything
    invented after about 1966...
    Same goes for the rest of the fabulous
    features he names (except maybe for the "post-conditional" thing,
    whatever that is): All programming languages do that stuff. But very few of them bury it under such an enormous steaming pile of shit.

    Make that 1958 (Lisp 1).



  • I’ve worked in MUMPS for much of the 90s and I’ll not hear anyone talk bad of it..<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>

    <o:p> </o:p>

    Where else can you write code that is absolutely meaningless to anyone not equally skilled in that exact language, without actually setting out to do so?<o:p></o:p>

    <o:p> </o:p>

    The special bit is that you can abbreviated all commands so instead of FOR you can just have ‘f’..<o:p></o:p>

    <o:p> </o:p>

    Here’s an example (exact syntax might be wrong as it has been a while! but it’ll be pretty close)..<o:p></o:p>

    F  Q:$D(^Bollocks)  D<o:p></o:p>

    .  blah<o:p></o:p>

    . F i=1:1:10000 Q:$D(done)  D<o:p></o:p>

    . . w !,”part of second loop”<o:p></o:p>

    . . blah<o:p></o:p>

    . w !,”part of first loop not second”<o:p></o:p>

    <o:p> </o:p>

    A few things here.. <o:p></o:p>

    The F followed by 2 spaces means it’s basically a while loop, quiting when the shared data object “bollocks” has something in it.<o:p></o:p>

    The F followed by i:1:1:10000 is a for loop, from 1 by 1 to 100000. This quit when there is data in a local variable called done.<o:p></o:p>

    The D with 2 spaces before it basically says to do everything in the dots below.<o:p></o:p>

    <o:p> </o:p>

    -or-<o:p></o:p>

    <o:p> </o:p>

    s a = “” f  a=$o(^book(a)) q:a=""  d<o:p></o:p>

    . w !,a<o:p></o:p>

    <o:p> </o:p>

    Here, the $O is saying to get the next row in the disk data object called book and it’ll keep looping through, writing to the screen until complete.<o:p></o:p>

    <o:p> </o:p>

    Today’s languages are all about writing maintainable and quality code.. Not in MUMPS.. No point trying to write ‘show your friends’ code here.. <o:p></o:p>

    <o:p> </o:p>

    Gone are the days of try cowboy coding.. Damn you “OO”.
    You guys have it too easy this day with your 'structured programing' and 'maintainable code'.. when I was a lad..[cough]

    <o:p> </o:p>

    For those of you still reading..

    <o:p></o:p>

    <o:p> </o:p>

    <o:p> </o:p>

    --<o:p></o:p>

    Sam<o:p></o:p>



  • I've had some experience with M as well.  A couple of notes on the notes you make:

    • Everything being a string:  That isn't quite accurate.  In the following code:
           S FOO="12"

           Foo is a string, not an integer.  If you

           W FOO+13
       
           You'll get 25, but if

           S FOO="BAR" W BAR+13

           You'll get 13.  No.  Really.

    • In order to retain sanity, PLEASE ensure that you 'N'ew every variable used in each linetag/routine.  A lot of the older code I had the chance to use depended on the "everything is global" behaviour you're discussing here, leading to a situation where you'd set three local variables (which are "globals" in the common sense, but Mumps global variables are actually files on the hard drive), call a routine, and have the local variables magically changed to the new values you needed.
    • If statements.  Due to the behaviour you noted in your third point, NEVER EVER USE AN 'ELSE' statement.  The ELSE construct simply evaluates the $T(RUTH) local variable and executes the code block following the ELSE construct if $T evaluates to 0.  The fly in the ointment here is (again) the scoping of "local" variables in Mumps.  Executing an IF statement sets the $T variable.  Or (even though this isn't considered quite kosher), you can set $T manually.  Which means that it is entirely possible that, given the code:
        I $D(^FOO) D
        .S BAR=$$BAR^BAZ
        E
        .S BAR=$$BAZ^BAR

              and have BOTH branches of the IF statement get executed.

    • Plus, you have the whole command abbreviation thing in that each command has a single letter abbreviation, which serves two purposes
      • It allows the programmer to save wear and tear on his or her fingers.
      • It obfuscates the hell out of the code for the uninitiated.
    Now, don't get me wrong.  M does have some good points (all data is sorted by default in arrays, and performance of M systems tends to be very good).  The biggest problem is that going to an M system is a big step back to the 1960s for programmers that have been raised on a steady diet of Java and C# and are used to a certain amount of handholding.



  • @Fat Sam said:

    Where else can you write code that is absolutely meaningless to anyone not equally skilled in that exact language, without actually setting out to do so?<o:p></o:p>



    Perl.  Great language if you try to be clean, but if you're even a small bit lax, and do not resist the urge to be clever, you come back to things involving splice, map and grep that make sane men run.



  • @DevNull said:


    • Everything being a string:  That isn't quite accurate.  In the following code:
           S FOO="12"

           Foo is a string, not an integer.  If you

           W FOO+13
       
           You'll get 25, but if

           S FOO="BAR" W BAR+13

           You'll get 13.  No.  Really.



    still better than MAGIC (which, I repeat, was developed by some of the same people who developed M)... check this out:

     "12"^F
     F+13 is 25 as expected.

     "BAR"^F
     F+13.. wait for it...  "199K"!  mega-awesome!
     "a"+1? "1X"
     "b"+1? "1Y"

     etc, etc.
    I know there's a method to this madness, but really... WTF??



  • @yours truly said:


     "BAR"^F
     F+13.. wait for it...  "199K"!  mega-awesome!


    I forgot to mention, "199K"-13 gives you "BAR", right? Nope!  it results in "198H"!



  • @your mom said:

    @yours truly said:

     "BAR"^F
     F+13.. wait for it...  "199K"!  mega-awesome!


    I forgot to mention, "199K"-13 gives you "BAR", right? Nope!  it results in "198H"!

    <FONT face="Courier New" size=2>ah.  it was only a matter of time before magic would raise its ugly head on the dailywtf.  the handling of if/else was always bizarre, and in a function subroutine you can have your choice of local variables A-Z.  if you want a more descriptive variable name, feel free to use the system's local variables, which were actually global.  manage your own namespace because a computer can't do it for you.</FONT>

    <FONT face="Courier New" size=2>at the old company i used to work for, they had a new version of magic/mumps which enabled the programmer to enter the early 1980s, with a gui.  the environment was very similar in feel to smalltalk, minus the objects.  gui programming in this system was similar to writing HTML 1.0, except that you had to couple the GUI to (what they called) an 'object'.  'objects' were basically structs, and they system took care of maintaining the 'database' of 'objects' by writing out flat-files to disk.  the format was basically to write out the contents of an instance as a string.  when it changed, write out another string.  in this way you get a historical record and thrash drives.  indexing of the database is an amazing topic that deserves its own story.</FONT>

    <FONT face="Courier New" size=2>honestly, i believe that magic is one of the few langauges whose interpreter cannot be written in magic.</FONT>

    <FONT face="Courier New" size=2>i don't really understand what was happening in boston in the early 70's, but i'm guessing that neil pappalardo was probably snorting enough cocaine to kill a small elephant when he came up with the idea for magic.  his philosophy was that if you own all aspects of a language and system, and charge your customers support fees, then you can indefinitely maintain a cocaine habit and develop some of the worst applications actually used by businesses.</FONT>

    <FONT face="Courier New" size=2>a programmer has to not only grapple with code that makes seasoned perl programmers from eastern europe cringe, but also deal with interfaces that shift on the whims of eight or so assclowns in boston that think they can duplicate java and hold an MBA degree at the same time.</FONT>

    <FONT face="Courier New" size=2>for the curious, to recreate the experience of programming in magic, grab some old C code, before 1980.  then, eliminate all type specifiers except for int and char (you'll pointers to address values on the stack), do not use macros, do not use the standard library, you are not allowed to use for or while loops (only do,while loops).  all functions must have void return values.  then, try to re-write the old program under these conditions.  every three to five weeks, take 10 random functions and either change the order and content of their parameters or eliminate them entirely.</FONT>

    <FONT face="Courier New" size=2>that's pretty much it.</FONT>



  • @emptyset said:

    <FONT face="Courier New" size=2>honestly, i believe that magic is one of the few langauges whose interpreter cannot be written in magic.</FONT>

    <FONT face="Courier New" size=2>i'm sorry, very hungover.  meant to say, i believe you cannot write the magic interpreter in magic.</FONT>



  • I managed to start a new thread with my reply, sorry.



  • @your mom said:

    @Albatross said:

    And this is different from VB6 how...?



    trust me, if you coded in MUMPS or MAGIC, you would wish you were lucky enough to get to code in VB...




    MAGIC? I've just seen a presentation of MAGIC, but it hardly looks like
    a system that lets you write code at all. It's all menus, dialogs, more
    dialogs, property sheets etc. Define it all in the repository and -
    voila - you get an application that lets you manipulate data in the
    database. If you think that this isn't impressive, look at their
    prices. They are. ;-)


Log in to reply