README update
This commit is contained in:
parent
a0fa7cdac2
commit
6b76a9f612
67
README.md
67
README.md
@ -1,4 +1,4 @@
|
|||||||
# GPL MUMPS by Example
|
# MUMPS Examples
|
||||||
|
|
||||||
**MUMPS** ("Massachusetts General Hospital Utility Multi-Programming System"), or **M**, is a general-purpose computer programming language originally designed in 1966 for the healthcare industry. Its differentiating feature is its "built-in" database, enabling high-level access to disk storage using simple symbolic program variables and subscripted arrays; similar to the variables used by most languages to access main memory. [Read more...](https://en.wikipedia.org/wiki/MUMPS)
|
**MUMPS** ("Massachusetts General Hospital Utility Multi-Programming System"), or **M**, is a general-purpose computer programming language originally designed in 1966 for the healthcare industry. Its differentiating feature is its "built-in" database, enabling high-level access to disk storage using simple symbolic program variables and subscripted arrays; similar to the variables used by most languages to access main memory. [Read more...](https://en.wikipedia.org/wiki/MUMPS)
|
||||||
|
|
||||||
@ -9,26 +9,38 @@ The implementations currently available are:
|
|||||||
- [MUMPS Database and Language by Ray Newman](http://sourceforge.net/projects/mumps/)
|
- [MUMPS Database and Language by Ray Newman](http://sourceforge.net/projects/mumps/)
|
||||||
- [Open Mumps](http://www.cs.uni.edu/~okane/)
|
- [Open Mumps](http://www.cs.uni.edu/~okane/)
|
||||||
|
|
||||||
The examples in this tutorial are run with GPL Mumps.
|
The examples in this tutorial are run with both GPL Mumps and GT.M.
|
||||||
|
|
||||||
## Prerequisites
|
## Prerequisites
|
||||||
|
|
||||||
|
### GPL Mumps
|
||||||
|
|
||||||
- [The Mumps Programming Language](https://www.cs.uni.edu/~okane/)
|
- [The Mumps Programming Language](https://www.cs.uni.edu/~okane/)
|
||||||
- [Mumps Language Users' Guide](https://www.cs.uni.edu/~okane/source/MUMPS-MDH/ReadMe.pdf)
|
- [Mumps Language Users' Guide](https://www.cs.uni.edu/~okane/source/MUMPS-MDH/ReadMe.pdf)
|
||||||
- [Mumps Language Quick Introduction & Tutorial](https://www.cs.uni.edu/~okane/source/MUMPS-MDH/MumpsTutorial.pdf)
|
- [Mumps Language Quick Introduction & Tutorial](https://www.cs.uni.edu/~okane/source/MUMPS-MDH/MumpsTutorial.pdf)
|
||||||
|
|
||||||
|
### GT.M
|
||||||
|
|
||||||
|
- [MUMPS Technology Portal](http://mumps.cz/)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## Quick Setup
|
## Quick Setup
|
||||||
|
|
||||||
Download the open source distribution of the [Mumps interpreter](https://www.cs.uni.edu/~okane/source/MUMPS-MDH/mumps-18.02.src.tar.gz) and run the following commands:
|
### GPL Mumps
|
||||||
|
|
||||||
|
To install the open source distribution of the Mumps interpreter:
|
||||||
|
|
||||||
|
cd /usr/local/src
|
||||||
|
wget https://www.cs.uni.edu/~okane/source/MUMPS-MDH/mumps-18.02.src.tar.gz
|
||||||
tar -zxvf mumps-18.02.src.tar.gz
|
tar -zxvf mumps-18.02.src.tar.gz
|
||||||
cd mumpsc
|
cd mumpsc
|
||||||
sudo ./ConfigureNative.script
|
./ConfigureNative.script
|
||||||
sudo ./BuildMumpsWithGlobalsInSingleUserNative.script
|
./BuildMumpsWithGlobalsInSingleUserNative.script
|
||||||
|
|
||||||
The resulting interpreter is located in `/usr/bin/mumps`.
|
The resulting interpreter is located in `/usr/bin/mumps`.
|
||||||
|
|
||||||
$ mumps
|
mumps
|
||||||
|
|
||||||
Mumps 17.30; Built: 16:05:53 Sep 23 2019
|
Mumps 17.30; Built: 16:05:53 Sep 23 2019
|
||||||
Float: double; DBMS: Native Stand Alone; Hardware math: yes; Int: int; Float digits: 6; Cache: 33; Block: 2048; FP Bits: N/A
|
Float: double; DBMS: Native Stand Alone; Hardware math: yes; Int: int; Float digits: 6; Cache: 33; Block: 2048; FP Bits: N/A
|
||||||
@ -40,14 +52,44 @@ The resulting interpreter is located in `/usr/bin/mumps`.
|
|||||||
> halt
|
> halt
|
||||||
EOF - goodbye ...
|
EOF - goodbye ...
|
||||||
|
|
||||||
|
To uninstall GPL Mumps:
|
||||||
|
|
||||||
|
cd /usr/local/src/mumpsc
|
||||||
|
make uninstall
|
||||||
|
rm -f /usr/bin/mumps*
|
||||||
|
|
||||||
|
### GT.M
|
||||||
|
|
||||||
|
To install GT.M on Debian based OS:
|
||||||
|
|
||||||
|
apt-get install fis-gtm
|
||||||
|
|
||||||
|
Set up the environment variables:
|
||||||
|
|
||||||
|
source /usr/lib/x86_64-linux-gnu/fis-gtm/V6.3-003A_x86_64/gtmprofile
|
||||||
|
|
||||||
|
Open the GT.M prompt:
|
||||||
|
|
||||||
|
gtm
|
||||||
|
|
||||||
|
GTM>write "Hello world"
|
||||||
|
Hello world
|
||||||
|
GTM>halt
|
||||||
|
|
||||||
|
To uninstall GT.M:
|
||||||
|
|
||||||
|
apt-get purge fis-gtm
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## 1. The Very Basics
|
## 1. The Very Basics
|
||||||
|
|
||||||
### [`01-hello-world.mps`](https://github.com/programarivm/gpl-mumps-by-example/blob/master/01-the-very-basics/01-hello-world.mps)
|
### [`01-hello-world.mps`](https://github.com/programarivm/gpl-mumps-by-example/blob/master/01-the-very-basics/01-hello-world.mps)
|
||||||
$ mumps 01-hello-world.mps
|
|
||||||
Hello world
|
Hello world
|
||||||
|
|
||||||
### [`02-hello-world-in-a-loop.mps`](https://github.com/programarivm/gpl-mumps-by-example/blob/master/01-the-very-basics/02-hello-world-in-a-loop.mps)
|
### [`02-hello-world-in-a-loop.mps`](https://github.com/programarivm/gpl-mumps-by-example/blob/master/01-the-very-basics/02-hello-world-in-a-loop.mps)
|
||||||
$ mumps 02-hello-world-in-a-loop.mps
|
|
||||||
Hello world
|
Hello world
|
||||||
Hello world
|
Hello world
|
||||||
Hello world
|
Hello world
|
||||||
@ -60,7 +102,7 @@ The resulting interpreter is located in `/usr/bin/mumps`.
|
|||||||
Hello world
|
Hello world
|
||||||
|
|
||||||
### [`03-hello-world-in-another-loop.mps`](https://github.com/programarivm/gpl-mumps-by-example/blob/master/01-the-very-basics/03-hello-world-in-another-loop.mps)
|
### [`03-hello-world-in-another-loop.mps`](https://github.com/programarivm/gpl-mumps-by-example/blob/master/01-the-very-basics/03-hello-world-in-another-loop.mps)
|
||||||
$ mumps 03-hello-world-in-another-loop.mps
|
|
||||||
Hello world
|
Hello world
|
||||||
Hello world
|
Hello world
|
||||||
Hello world
|
Hello world
|
||||||
@ -73,7 +115,7 @@ The resulting interpreter is located in `/usr/bin/mumps`.
|
|||||||
Hello world
|
Hello world
|
||||||
|
|
||||||
### [`04-hello-world-in-a-nested-loop.mps`](https://github.com/programarivm/gpl-mumps-by-example/blob/master/01-the-very-basics/04-hello-world-in-a-nested-loop.mps)
|
### [`04-hello-world-in-a-nested-loop.mps`](https://github.com/programarivm/gpl-mumps-by-example/blob/master/01-the-very-basics/04-hello-world-in-a-nested-loop.mps)
|
||||||
$ mumps 04-hello-world-in-a-nested-loop.mps
|
|
||||||
1:1 Hello world
|
1:1 Hello world
|
||||||
1:2 Hello world
|
1:2 Hello world
|
||||||
1:3 Hello world
|
1:3 Hello world
|
||||||
@ -86,7 +128,7 @@ The resulting interpreter is located in `/usr/bin/mumps`.
|
|||||||
2:5 Hello world
|
2:5 Hello world
|
||||||
|
|
||||||
### [`05-arithmetic-operations.mps`](https://github.com/programarivm/gpl-mumps-by-example/blob/master/01-the-very-basics/05-arithmetic-operations.mps)
|
### [`05-arithmetic-operations.mps`](https://github.com/programarivm/gpl-mumps-by-example/blob/master/01-the-very-basics/05-arithmetic-operations.mps)
|
||||||
mumps 05-arithmetic-operations.mps
|
|
||||||
There were 7 apples, 8 pears and 9 oranges,
|
There were 7 apples, 8 pears and 9 oranges,
|
||||||
a total of 24 fruits in a basket.
|
a total of 24 fruits in a basket.
|
||||||
Then, something happened:
|
Then, something happened:
|
||||||
@ -95,7 +137,7 @@ The resulting interpreter is located in `/usr/bin/mumps`.
|
|||||||
the average fruit value is 7.
|
the average fruit value is 7.
|
||||||
|
|
||||||
### [`06-arrays.mps`](https://github.com/programarivm/gpl-mumps-by-example/blob/master/01-the-very-basics/06-arrays.mps)
|
### [`06-arrays.mps`](https://github.com/programarivm/gpl-mumps-by-example/blob/master/01-the-very-basics/06-arrays.mps)
|
||||||
mumps 06-arrays.mps
|
|
||||||
Approaching the solar system:
|
Approaching the solar system:
|
||||||
Mercury
|
Mercury
|
||||||
Venus
|
Venus
|
||||||
@ -125,7 +167,6 @@ The resulting interpreter is located in `/usr/bin/mumps`.
|
|||||||
|
|
||||||
### [`01-factorial-by-reference.mps`](https://github.com/programarivm/gpl-mumps-by-example/blob/master/02-user-defined-functions/01-factorial-by-reference.mps)
|
### [`01-factorial-by-reference.mps`](https://github.com/programarivm/gpl-mumps-by-example/blob/master/02-user-defined-functions/01-factorial-by-reference.mps)
|
||||||
|
|
||||||
mumps 01-factorial-by-reference.mps
|
|
||||||
Enter n: 5
|
Enter n: 5
|
||||||
5! = 120
|
5! = 120
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user