MUMPS

Content:

Original link: The Database Powering America’s Hospitals May Not Be What You Expect / Hackaday.

MUMPS or M is a funny language.

Very simple code snippet:

test()
  for i=1:1:3 do
    . write "Hi from Mumps!",!
  quit

This is actually sort of readable. But commands can be abbreviated, so that code can also be written as:

test2()
  f i=1:1:3 d
    . w "Hi from Mumps!",!
  q

And now it is not so readable.

This big advantage is the database (hierachical database not relational database!) integration.

Variables that are prefixed with ^ get automatically loaded from and saved to a database. Todays ORM's are quite clumsy compared to it.

Example:

globinit()
  set ^v=0
  set ^m("xyz")="ABC"
  quit
glob()
  set ^v=^v+1
  write ^v,!
  set ^m("xyz")=^m("xyz")_"."
  write ^m("xyz"),!
  quit

Comments: