Mumpster
http://mumpster.org/

Lil'M and the Reference Implementation of the MDC
http://mumpster.org/viewtopic.php?f=22&t=50
Page 1 of 1

Author:  whitten [ Tue Nov 23, 2010 10:11 am ]
Post subject:  Lil'M and the Reference Implementation of the MDC

Many years ago, in the time that GUMP walked the earth, Larry ("Gus") and I discussed the fact that the skills needed for the implementation of MUMPS has usually been separated out from the skills needed for the use of MUMPS because the language of implementation has usually been C or Assembly Language. One idea we kicked around was that if we had only a core subroutines needed for MUMPS which was written in another language, but did all the rest of the MUMPS implementation in a simple subset of MUMPS (which we called Lil'M ) we could increase the skills and knowledge that the MDC would need in its own membership, rather than having the MDC people perpetually dependent upon others.

The idea would be that we would write the Reference Implementation in Lil'M.

This topic is intended to collect what syntax is the essential syntax for Lil'M that the full MUMPS syntax could be transformed and reduced into.

Author:  ldl [ Tue Nov 23, 2010 10:12 pm ]
Post subject:  Re: Lil'M and the Reference Implementation of the MDC

A snapshot of one discussion item. I don't know when this really occurred
as DJW and I have been discussing this for years.. definitely since before
2000 (so the 20091020 date is probably 10 years after the "deed").

Note that the spacing on the lines is lost in this post... I'll see what I can
do to remedy this... If not please "imagine" that the lines without a tag have
a leading space.

---
ldl@anGus:/var/laptop/boGus.20091020/ldl/LittleM$ cat Mm.idea
A simplification of 'M' to 'm' is the removal of the dotted
do notation. So, are there any problems with the following?
Any issues? Just wanting to make sure I'm not missing anything...

Illustrates multiple levels of dotted-do with localized
goto targets, etc...

TAG ;
s usage=$g(^DBK)
g:'+usage skipd
s vout="v.dat" o vout
s uout="u.dat" o uout
s gout="g.dat" o gout
date s d="" f s d=$o(^DBK(d)) q:d="" d
. s dt=$zd(d),dt=19_$p(dt,"/",3)_$p(dt,"/")_$p(dt,"/",2)
. s usage=$g(^DBK(d))
. g:'+usage skipv
vol . s v="" f s v=$o(^DBK(d,v)) q:v="" d
. . s usage=$g(^DBK(d,v))
. . g:'+usage skipu
. . u vout w dt_","_v,!
uci . . s u="" f s u=$o(^DBK(d,v,u)) q:u="" d
. . . s usage=$g(^DBK(d,v,u))
. . . g:'+usage skipg
. . . u uout w dt_","_v_","_u_","_+usage,!
gbl . . . s g="" f s g=$o(^DBK(d,u,v,g)) q:g="" d
. . . . s usage=$g(^DBK(d,v,u,g))
. . . . u gout w dt_","_v_","_u_","_g_","_+usage,!
skipg . . . u gout w "---",!
skipu . . u uout w "---",!
skipv . u vout w "---",!
skipd c vout
c uout
c gout

Equivalent linear code, expect that &# are unique invented labels:

TAG ;
s usage=$g(^DBK)
g:'+usage skipd
s vout="v.dat" o vout
s uout="v.dat" o uout
s gout="v.dat" o gout
s d="" f s d=$o(^DBK(d)) q:d="" d &1
skipd c vout
c uout
c gout
q
&1 ; -----------------------------------------------------
s dt=$zd(d),dt=19_$p(dt,"/",3)_$p(dt,"/")_$p(dt,"/",2)
s usage=$g(^DBK(d))
g:'+usage skipv
vol s v="" f s v=$o(^DBK(d,v)) q:v="" d &2
skipv u vout w "---",!
q
&2 ; -----------------------------------------------------
s usage=$g(^DBK(d,v))
g:'+usage skipu
u vout w dt_","_v,!
uci s u="" f s u=$o(^DBK(d,v,u)) q:u="" d &3
skipu u uout w "---",!
q
&3 ; -----------------------------------------------------
s usage=$g(^DBK(d,v,u))
g:'+usage skipg
u uout w dt_","_v_","_u_","_+usage,!
gbl s g="" f s g=$o(^DBK(d,u,v,g)) q:g="" d &4
skipg u gout w "---",!
q
&4 ; -----------------------------------------------------
s usage=$g(^DBK(d,v,u,g))
u gout w dt_","_v_","_u_","_g_","_+usage,!
q
; -----------------------------------------------------


Another semi-obtuse transformation... Whether the program does
anything meaningful or not is not important, are the two equivalent?

s j=1
TAG d f i=0:0 d q:i d w i,j!
inner . s j=j+1 s:j=40 i=j
w "Done",!
Maps to:
s j=1
TAG d &1 f i=0:0 d &1 q:i d &1 w i,j!
w "Done",!
q
&1 ; -----------------------------------------------------
inner s j=j+1 s:j=40 i=j
q
; -----------------------------------------------------
ldl@anGus:/var/laptop/boGus.20091020/ldl/LittleM$

Author:  raynewman [ Thu Feb 03, 2011 2:56 pm ]
Post subject:  Re: Lil'M and the Reference Implementation of the MDC

As part of my masters I wrote most of a MUMPS compiler for MV1 in MUMPS. If anyone wants it, I'll dig it out for them.

Ray Newman

Author:  toad [ Tue Feb 15, 2011 6:40 pm ]
Post subject:  Re: Lil'M and the Reference Implementation of the MDC

Ray, I imagine that would be very helpful to the Lil'M effort and quite interesting in its own right.

Author:  toad [ Tue Feb 15, 2011 6:42 pm ]
Post subject:  Re: Lil'M and the Reference Implementation of the MDC

If I remember correctly, the predecessor to the Lil'M idea was Peter Beaman's work on Datatree MUMPS. I believe he wrote many of the system tools and some of the MUMPS language itself in MUMPS; these were just some of the innovations for which DTM was famous.

Page 1 of 1 All times are UTC - 8 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/