It is currently Tue Nov 21, 2017 4:37 am


All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Lil'M and the Reference Implementation of the MDC
PostPosted: Tue Nov 23, 2010 10:11 am 
User avatar

Joined: Wed Nov 17, 2010 4:02 pm
Posts: 68
Location: Houston TX
Real Name: David Whitten
Began Programming in MUMPS: 06 Jan 1982
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.


Top
Offline Profile  
 
 Post subject: Re: Lil'M and the Reference Implementation of the MDC
PostPosted: Tue Nov 23, 2010 10:12 pm 
Site Admin

Joined: Mon Nov 01, 2010 1:31 pm
Posts: 10
Location: Las Cruces, NM 88012 USA
Real Name: LD "Gus" Landis
Began Programming in MUMPS: 15 Aug 1991
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$

_________________
3960 Schooner Loop 651-340-4007
Las Cruces, NM 88012-6067


Top
Offline Profile  
 
 Post subject: Re: Lil'M and the Reference Implementation of the MDC
PostPosted: Thu Feb 03, 2011 2:56 pm 
User avatar

Joined: Mon Nov 01, 2010 3:33 pm
Posts: 103
Location: Australia
Real Name: Ray Newman
Began Programming in MUMPS: 01 Jul 1976
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


Top
Offline Profile  
 
 Post subject: Re: Lil'M and the Reference Implementation of the MDC
PostPosted: Tue Feb 15, 2011 6:40 pm 
Site Admin
User avatar

Joined: Mon Nov 01, 2010 1:58 pm
Posts: 205
Location: Seattle, Washington
Real Name: Frederick D. S. "Rick" Marshall
Began Programming in MUMPS: 15 Jun 1984
Ray, I imagine that would be very helpful to the Lil'M effort and quite interesting in its own right.

_________________
Frederick D. S. "Rick" Marshall, VISTA Expertise Network, 819 North 49th Street, Suite 203, Seattle, Washington 98103, (206) 465-5765, rick dot marshall at vistaexpertise dot net
"The hidden harmony is best." - Heraclitus of Ephesus


Top
Offline Profile  
 
 Post subject: Re: Lil'M and the Reference Implementation of the MDC
PostPosted: Tue Feb 15, 2011 6:42 pm 
Site Admin
User avatar

Joined: Mon Nov 01, 2010 1:58 pm
Posts: 205
Location: Seattle, Washington
Real Name: Frederick D. S. "Rick" Marshall
Began Programming in MUMPS: 15 Jun 1984
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.

_________________
Frederick D. S. "Rick" Marshall, VISTA Expertise Network, 819 North 49th Street, Suite 203, Seattle, Washington 98103, (206) 465-5765, rick dot marshall at vistaexpertise dot net
"The hidden harmony is best." - Heraclitus of Ephesus


Top
Offline Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Theme created StylerBB.net