[plt-scheme] A crazy idea (fMUMPS)
I don't know how many of you have heard of MUMPS. It's an ancient
language (but hey, this is a Scheme list!) that is used primarily for
healthcare (and financial) applications. I've been a developer for
VistA, a health information system developed by the U.S. Dept. of
Veterans Affairs (see http://www.hardhats.org and
http://www.va.gov/vista for more information) for years now, and have
often thought that the basic language wants to be functional,
especially in the way it is used (with lots of indirection to simulate
higher order features and extensive list manipulation).
The basic data stucture is a hierarchical array. A typical example is
something like this
BAY>ZWRITE A
A(1)="ONE"
A(2)="TWO"
A(3,1)="WHATEVER"
A("ALPHA")="BETA"
MUMPS arrays differ from Perl hashes or Python dictionaries in that the
subscripts at a given level are ordered, and can be traversed like so
BAY>SET I="" FOR SET I=$ORDER(A(I)) QUIT:I="" WRITE !,I
1
2
3
ALPHA
It is also possible to walk the entire tree
BAY>SET REF="A" FOR SET REF=$QUERY(@REF) QUIT:REF="" WRITE !,REF," =
",$GET(@REF)
A(1) = ONE
A(2) = TWO
A(3,1) = WHATEVER
A("ALPHA") = BETA
My thought is to treat these arrays as values (like lists in Scheme)
and provide primitives to get a node value (if defined) a list of
children, and perhaps the subtree(s) below a node in normall collating
sequence (like cdr).
What is interesting, though, is that arrays may either be local in
MUMPS jargon (stored in a process' memory) or "global", meaning they
are objects that exist on disk and support concurrent access by
multiple processes "Global" arrays have names begininning with "^"
(e.g., "^A"), and can be very big. For example the globals storing
orders and progress notes can easily contain on the order of 1 million
or 10 million separate records. Though they could conceptually be
treated as values, they obviously cannot even be loaded into (physical)
memory. This, of course, rasises the question of whether a functional
style of programming could be used with these huge arrays, and whethe
that would be desirable.
===
Gregory Woodhouse <gregory.woodhouse at sbcglobal.net>
"Interaction is the mind-body problem of computing."
--Philip L. Wadler