HI AND WELCOME TO STARTING OUT PROGRAMMING
IN G15 PMN WITH THE BROWSER-FRIENDLY VERSION!
*******************************************
*******************************************
First some quick hints for those who already
know G15 PMN, or scroll onwards for tutorial:
Get Background page up rather first,
as it activates the machinery; then
get a suitable display and keyboard page up;
and also get the mount page up. After each
mount, re-enter Background page and either
refresh it or (which is the same) click the
button on that page, to restart G15 PMN.
To save your works, get them to k1 and
select ZIPDISK on mount. To copy cards
from one location to another, type ccw
and command 'c' for cp. You can also
swap whole disks in the mount section.
All the following applies to all the
versions of G15 PMN, at least as long as the
updated TF with the Crete Card Writer CCW
is started. Here's [fdisk.zip] so you can put it
to your PC when you have G15 PMN installed on it.
[This also has the motorsip.txt which is only
used when you connect to a robot like xArm7,
to specify which address it has.]
[If you have Windows, type WSL and install
Ubuntu and via "sudo apt install" and such
other typical programs like gimp, gedit and
what not. After that, you can use eg the
./neong15pmn in the 'classic' neong15ways.zip
package there. Here, you use the Del button
to switch to in-frame instead of fullscreen
so mouse works correctly also in a more
X Windows like environment. To cure this just
unzip g15rwx.zip into it and start ./g15rwx
More variations at g15pmn.com.
The batch version is a full version of G15 PMN
except just for a few interactive features.
The batch robotics version G15BG is like G15BR
except that it has more technical command
options. G15BR must be secure in being online
so it doesn't change other files than its
own dedicated disks, represented as files.]
To see where the G15 PMN documentation
is, type
^h1
car
To edit k1 or anywhere else,
ccw
To find definition eg of 'makefit', type
scan
makefit=
f1
9999
car
When you use car, to get to the next
page, in the SEND field send a space.
To find definition of underlaying one-
and two-letter words in G15 assembly,
use scan similarly but put a space
first and a colon after. Eg, for 'up':
scan
up:
f1
car
To find next match after use of scan,
press an extra ENTER to leave the car and type
mmm
and eg type car again. You can also type pp
to view which card it is an open it in ccw,
the Crete Card Writer made for the batch
versions of G15 PMN, including G15BR/G15BG.
To see an example of the use eg of the long text
quote PMN feature called LONGTXT* type
scan
longtxt*
f1000
9999
Note that when you say f1000 you skip most of
the assembly definitions. PMN interactive compiler
is written in G15 assembly and begins right after.
In that way, you get on to an example of LONGTXT*
rather than the definition of it. The '9999' is
of course a bit luxurious, typically 2000-3000
is enough, but it's all very fast so we make it easy.
To view a text like h33 without opening b9edit, type
^h33
more
To switch all of TF to the b9 font, type
lush
To exit the TF eg before mount or restart, type
qu
When you program using CCW and you need eg two
extra cards inserted in the middle after k4,
type c for copy and select copy from k4 to k6
and be sure to specify a quantity of cards
that is more than big enough to cover the range.
When you wish to remove a card, let's say k19,
type c for copy and select copy from k20 to k19,
and a similar large range. Intense cardwork is
easier when several card series aren't stuffed
tightly. For programming purposes, typically
work on a disk with just one program. Working
finished products you can put straight after
one another on a single disk when there's room.
***********************************************
***********************************************
TUTORIAL PROPER [the above are hints
to refresh memory for those who already
know G15 PMN]
THIS INFO IS ABOUT THE BROWSER-FRIENDLY
VERSION. NOTE THAT G15 PMN CAN RUN ON
ANY PC WITH ANY STANDARD LINUX INCLUDING
WSL WINDOWS UBUNTU BUT THAT KEYBOARD IN
WINDOWS SHOULD BE SET TO US RATHER THAN UK
TO GET THE NORMAL FULL FUNCTIONALITY OF THE
APOSTROPHE KEY, NAMELY THAT ONE CLICK OF IT
PRODUCES THE ' CHARACTER. OTHER LANGUAGES
CAN HAVE A PRESENCE ON G15 PMN BUT THE
FOUNDATION OF THE LANGUAGE IS US ASCII.
UPCOMING CAPITAL TEXT PARTS OF THIS DOCUMENT
ARE WRITTEN TOGETHER WITH THE LAUNCHING OF THE
YOGA6DSERVER.ORG WITH ITS BROWSER-FRIENDLY
VERSION OF G15 PMN. THE LOWERCASE IN THIS
DOCUMENT IS A SLIGHTLY MODIFIED EXCERPT
FROM OUR 2015 TEXT AT A PAGE UNDER G15PMN
DOT COM, NAMELY norskesites.org/fic3.
TO GET THE G15 PMN PROGRAMMING TERMINAL
UP, WHEN YOU GO INTO THE YOGA6DSERVER
SESSION:
CLICK ON THE LINK THAT SAYS
ACTIVATE G15 PMN PROCESS.
THAT PAGE HAS A USEFUL RESTART
BUTTON SO KEEP IT IN BACKGROUND.
CLICK ON A SUITABLE DISPLAY,
EG ONE OF THE FRAMES; CAN BE
THE SLOWFRAMES IF TOO MUCH
FLICKERING ON FRAMES.
ZOOM IT SO YOU BOTH HAVE
KEYBOARD INPUT AND SCREEN
VISIBLE. ON A TINY DEVICE,
YOU MAY WANT SEPARATE VIEW
OF INPUT AND SCREEN.
THEN START TYPING AND PRESS
ENTER BUTTON AFTER EACH
STATEMENT TO G15 PMN.
TO MOUNT A PROGRAM LIKE A
FRACTAL:
OPEN UP THE MOUNT PAGE.
CLICK ON THE 'FRACTAL'
BUTTON THERE.
GO TO THE BACKGROUND
PAGE AND CLICK RESTART.
THEN GO TO THE DISPLAY
WITH THE INPUT FIELDS
AND TYPE THE STARTUP
INSTRUCTIONS:
^k1
cc
get
WITH A PRESS ON ENTER
BUTTON AFTER EACH.
YOU CAN TYPE get AND
PRESS ENTER FOR A NEW
ONE. THIS USES ALSO WHAT
WE CALL 'RELATIVELY FREE
FLUCTUATION GENERATOR'
OR RFFG, WHICH IS TO SAY
THAT IT IS AN ALGORITHM
WHICH STARTS FROM SOME
MORE OR LESS COINCIDENTAL
INPUT AND CALCULATES A
RELATIVELY FREE--AS IF
"RANDOM" SEQUENCE FROM
THERE. BUT IT ALSO USES
THE IDEA OF FRACTAL
SIMILARITY OF FORM ACROSS
DIFFERENT SCALES. READ
ABOUT IT AT THE ANGELPEN
SECTION OF G15PMN.COM,
AND SEE THE CODE EXAMPLES
FOR THE FRACTALS THERE.
TO GET THE NORMAL TERMINAL
BACK, GO TO MOUNT PAGE
AND CLICK ON "TF" BUTTON.
THEN RESTART.
MOTIVATION:
WHY G15 PMN MAKES SENSE
G15 PMN IS MADE WITH THE HUMBLE AMBITION TO
HAVE A FORMAL LANGUAGE THAT ONE DAY MIGHT
REPLACE MATHEMATICS ETC. IT HAS BEEN PUT
TO USE IN AN APPROACH TO HAVE A COHERENT
RE-REPRESENTATION OF THE PREDICTIONS OF
BOTH QUANTUM AND GENERAL RELATIVITY PHYSICS
BUT WITHOUT THE INFINITY RIDDLES OF THESE.
THE RESPECT FOR INFINITY AS SOMETHING BEYOND
TYPICAL ATTEMPTS TO FORMALIZE IT RUNS THROUGH
THE DESIGN IDEAS OF G15 PMN FROM INSIDE OUT.
IT IS BY DESIGN AND BY INTENT MEANT TO BE
STIMULATING TO THE HUMAN MIND. THE PROGRAMS
TAKE PLACE IN A 32-BIT CONTEXT BECAUSE THESE
NUMBERS ARE WITHIN WHAT A HUMAN BEING CAN
EASILY READ AND RELATE TO IN TERMS OF NUMBERS
OF DIGITS. THE DISPLAY IS BRIGHT SPRING GREEN
AS THIS HAS BEEN FOUND TO BE MOST CONDUCIVE
TO GOOD BRAIN WORK AND ALSO WORKS ARTISTICALLY
IN A HARMONIOUS WAY WHEN DEPICTING HUMANS AND
NATURE AND ANYTHING ELSE. FIRST-HAND
PROGRAMMING IS CONSIDERED SUPERIOR, HERE,
TO SECOND-HAND PROGRAMMING USING STATISTICAL
PACKAGES AND LIBRARIES WHICH HAVE BEEN AUTO-
CONSTRUCTED AND WHICH TYPICALLY HARBOUR
INCOHERENT IDEAS. THE G15 PMN APPROACH IS
TO EMPHASIZE COHERENCE OF THE HUMAN MIND
IN HAVING ALL ASPECTS OF THE LANGUAGE HUMAN
READABLE AND AVAILABLE DIRECT. THE scan
FUNCTION IN G15 PMN 3RD FOUNDATION, THE
RIPE AND COMPLETE VERSON OF G15 PMN AS THE
GROUND ON WHICH ALL OTHER G15 PMN WORKS
STAND, GIVES INSTANT ACCESS TO ALL SOURCE
CODE BOTH G15 AND PMN AS DEFINING THE
LANGUAGE. THE LANGUAGE IS COMPILED EACH
TIME YOU START IT UP.
FOR ACKNOWLEDGEMENTS, ALSO TO FORTH
WHICH INSPIRED CA. HALF OF IT:
super-model-theory.pdf
THANKS ALSO FOR MANY CONVERSATIONS UP
TO CA YEAR 2000 WITH THE CO-FOUNDER OF
OBJECT-ORIENTED PROGRAMMING IN
THE 1960S, KRISTEN NYGAARD.
TUTORIAL: THE G15 PMN LANGUAGE
How to make a program that says Hello world!
loveworld=
^Hello world!
pp.
How to run it:
loveworld
YOU CAN GIVE IT A SHORTER NAME LIKE hi3 BUT
ONE AND TWO LETTER WORDS ARE DEFINED USING
G15 ASSEMBLY WHICH IS SOMEWHAT MORE INVOLVED
BUT DOABLE ALSO ON THE G15BR. USE LOWERCASE,
DO PAY ATTENTION TO GETTING THE DOT FIRMLY
AS THE LAST CHARACTER OF THE LAST LINE OF
EACH NEW PMN FUNCTION YOU MAKE. IN THE CARD
EDITORS, THE CLITDOT AS WE SOMETIMES CALL
IT IS LARGER AND MORE PROMINENT SO IT,
ALONGSIDE OTHER SYNTACTICAL FEATURES OF
THIS PROGRAMMING LANGUAGE, EASILY GETS
POSITIVE ATTENTION AND ALLOW MIND-CONCENTRATION.
PLEASE TYPE IT INTO THE STANDARD G15PMN TERMINAL
CALLED 'TF' (THIRD FOUNDATION) USING NO EXTRA
BLANKS, AND THE ENTER BUTTON AFTER EACH LINE.
IF YOU TYPE SOME LETTERS INTO THE 'SEND' FIELD
AND PRESS SEND, THIS IS SENT ONWARDS TO G15BR
WITHOUT THE LINESHIFT. YOU CAN THEN PRESS ENTER
AFTERWARDS. THE SEND FIELD CAN ALSO BE USED TO
PRESS ALL ESSENTIAL FUNCTION KEYS EVEN FROM A
TINY DEVICE WHICH DOESN'T HAVE FUNCTION KEYS!
OVERVIEW OVER HOW TO DO THIS YOU CAN FIND IN
THE LITTLE TEXT CALLED 'CTRCHARS.TXT' AND WHICH
IS LINKED TO FROM THE MAIN PAGE OF YOUR
NEW SESSION.
Such a program as above one can also type into a card
with two columns, large beautiful font and eight lines
in each card; to compile in a series of cards one uses
the command cc, such as
^k1
cc
which compiles in any program beginning with card 1
in disk k.
IN THE BROWSER-FRIENDLY VERSION: TYPE CCW TO OPEN
THE CRETE CARD WRITER, WRITTEN TO WORK WITH THIS
VERSION. IT IS EASY TO USE AND HAS SOME INFO ABOUT
HOW TO USE IT WHEN YOU CLICK 'i' AND PRESS ENTER.
How to make a loop that counts from one to ten, and
run it:
loopfun=
ll:10
i1
nn
lo.
loopfun
This uses the output 'nn', one of the predefined
(PD) words. By using a PD such as 'bx', one can
get it shown in a different font, and anywhere
on the standard defined screen. The graphics
mode is always available intermeshed with any
text usage, not just in the threaded-compiled
PMN functions, but also interactively, by
commands typed in.
Note that the ll is small letter LL, indicating
loop, while the i1 is the letter "i" plus the
digit 1.
How to make a number variable:
monthnum=
^.
How to set value of the number variable, and get it,
and show it:
12
monthnum
kl
monthnum
lk
nn
How to create a text constant:
dayname=
^Friday.
How to print out the text constant:
dayname
pp
How to create a text variable size 50 (note
that any text constant can be used as a
small text variable, it is a question of
whether to use the 'lk' and 'kl' two-letter
commands after it, or use it directly to
give its address; the two-letter commands
are all called 'predefined' (PD) commands
and these are all written directly in G15
while PMN proper are three letters and more:
yourname=
^.
50
sz
&&
yourname
kl
How to transfer text to the text variable:
yourname
lk
&Arianna&
tt
This retains the size set by the original 'sz'
command. However you can also change what the
variable points to simply by
&Wodehouse&
yourname
kl
How to transfer a parameter to a function,
let's say a function that multiplies a number
with itself and shows it:
longstocking=
f
mm
nn.
8
longstocking
This should give 64. Now, each function has
a bunch of easy to use variables, and the loop
already used one of them -- i1. Let us give
four values to a function and do some multiplication
and addition and so on with them in a complicated
way, without using the notion of stacks very much.
The above letter 'f' forged a duplicate on top of
the stack. In the next approach, we use the local
variables instead of such thinking. The only
reminder of the facts that stacks are used here
is that the first numbers are fetched in the
sequence of the highest-numbered parameter first.
We also give a comment here, to tell that there
are four numbers into this function. Further,
we also shows how the two columns typically used
in the cards 'speak to one another', making
programming a zen-like meditative process, quite
often:
THE FOLLOWING IS EASIEST TO PUT TO A CARD GIVEN
A CARD-EDITOR WHICH HAS A QUICK AND ELEGANT
METHOD TO IDENTIFY THE EXACT START OF THE SECOND
COLUMN IN EACH CARD. THE FULL G15 PMN ON A
STAND-ALONE PC DOES THIS BY CTR-R. IN THE MOUNT
BROWSER ONLINE VERSION OF G15 PMN THE COMMAND
ccw
IS THE KEY TO PROGRAM CARDS WITH TWO COLUMNS.
EVERY THING STORED ON DISK IN G15 PMN IS STORED
ON A DISK WITH LETTER FROM C TO L, WHERE A AND B
ARE READ-ONLY BOOTUP CORE DISKS FOR OUR
FROM-SCRATCH MADE G15 CPU PRACTICAL VIRTUAL
IMPLEMENTATION. AND EVERYTHING STORED ON DISKS
ARE STORED ON CARDS. A DOCUMENT WITH LONG TEXT
LINES AND ENTER CHARACTERS HERE AND THERE
ARE STORED AS A SERIES OF CARDS, COMPLETING
WITH A NILCARD, A CARD OF ASCII 0.
A PROGRAM ALSO COMPLETES WITH A NILCARD AFTER
IT, TO SIGNAL TO THE COMPILER THAT THERE AREN'T
MORE CARDS TO BE COMPILED JUST NOW BEFORE
POWER RETURNS TO THE INPUT TERMINAL.
A TEXT WITH LONG LINES CAN BE VIEWED BY A
COMMAND LIKE
^h33
more
TO SWITCH FONT, TRY
lush
^h33
more
TO OPEN CARD H:33 WHICH CONTAINS OUR ORIGINAL
DOCUMENTATION FOR THE THIRD FOUNDATION IN
B9EDIT, MOUNT B9EDIT FIRST, CLICK F3 AND
SELECT 4 FOR LOAD. F3 IN THE BROWSER VERSION
IS 'HEARTFACE' FOLLOWED BY THE DIGIT 3.
THE LOCATION OF THE DOCUMENTATION, H:33,
YOU CAN ALSO GET OUT OF THE SYSTEM IF YOU
TYPE
^h1
car
OR OPEN CARD h1 INSIDE THE CCW CRETE CARD
WRITER. WHEN YOU LOAD APPS IN THE FULL
VERSION OF G15PMN ON A PERSONAL COMPUTER,
THE CARD h:1 IS ALWAYS HAVING INFO ABOUT
THE APP. THERE, YOU MOUNT SOME BUT NOT ALL
DISKS, WITHOUT OVERWRITING EARLIER CONTENT.
THE MOUNTABLE DISKS ARE F, H, I, J, K, L.
L HAS SOMETIMES SPECIAL PURPOSES CONNECTED
TO A [PLANNED] NETWORK OF G15 COMPUTERS.
calculate= i1
|In:four nums i2
|Gives:one num ad
s4 i3
s3 mm
s2 i4
s1 mm.
A PROGRAM LIKE THIS CAN ALSO BE TYPED INTO
THE TERMINAL, BY PUTTING THESE THINGS ON
SEPARATE LINES AFTER ONE ANOTHER, LIKE
THIS (AT TERMINAL WE DROP THE COMMENTS):
calculate=
s4
s3
s2
s1
i1
i2
ad
i3
mm
i4
mm.
How to make a number constant:
pippi=
31415.
This reminds us to tell that the 32-bit whole
number approach taken with G15 PMN is also
done so that in the core G15 PMN there are
whole number versions of Sine, Cosine, and
related trigonometric functions, where a
certain number of decimal digits are assumed.
This is fast enough to do a whole range of
graphical applications and requires no extra
co-processor for mathematical operations.
Conditional expression -- is this number
above 5? If so it says yes, otherwise
it says no.
THIS CAN BE WRITTEN IN MANY WAYS. AS LARRY
WALL, AUTHOR OF PERL, USED TO SAY--THERE
ARE MANY WAYS OF DOING ANYTHING..
tellit= se
s1 w
&yes&
&no& pp
i1 sh.
5
gt
The way to read the card above is to
first read the left column, then the
right column. This is far more obvious
when shown in the CAR editor, of course.
However if the program is TYPED IN,
it is all typed in as one column.
The vertically is an enforced feature
of the language, which is found to
greatly clarify the content of the
functions as they move things around.
15
tellit
It will tell
yes
Explanation: the s1 stores to local
variable i1. The two texts are put to
stack. The gt compares greater. The
'se' sees whether the result of last
comparision worked out to Boolean true,
which is here 1, otherwise it is 0.
In such a case, it does a shift around
of the two topmost items on stack.
The 'se' acts on the NEXT line --
without any start or completion element
for any 'block' as in Forth IF THEN.
It prints on screen, pp. Then removes
the remaining item, by sh. Notice
that for most programs, blocks aren't
necessary to when one thinks it through,
especially not when one has the instant
informality of making new functions in
this way. Any required block is simply
made into a new function, and the se
and the more advanced d2 operator,
which is used to select one of a whole
range of options, can then pick out the
right one. Naming a block as a function
works fast enough and provides a natural
inline documentation of the program;
the fastest loops can still be made in
the underlaying G15 in cases of handling
eg a 500x500 image (also called, here,
a G15 GEM image) in a complicated way.
IN G15 PMN THERE IS A CERTAIN SHALL WE
SAY "GLOW" AROUND A CONCEPT WHICH
EXISTS IN ALMOST EVERY LANGUAGE BUT
OFTEN IN A CLUTTERED AND NON-STANDARDIZED
WAY, TYPICALLY NAMED SUCH AS 'POINTER'.
HERE WE CALL IT WARP. A FLOWER THAT
GROWS CAN WARP OUT A NEW BRANCH WITH
A NEW FLOWER. IT IS SOMETHING THAT
LEAPS, LIKE A QUANTUM LEAP. THE WARP
TO A FUNCTION IS A 'PORTAL' TO GET
TO THE FUNCITON. ETC. MORE INFO ABOUT
ALL OF G15 PMN, FROM BEGINNING
TUTORIALS FOR KIDS TO ADVANCED
COMPUTATIONAL NODE NETWORKS WITH
ROBOTICS FCM AT:
yoga6d.org/library
EG START WITH:
yoga6d.org/library/at1.pdf
PLS NOTE THAT THE PRESENT FORMAT OF
SOME OF THE PDFs AT THAT PDF
LIBRARY SHOWS CORRECTLY IN VIVALDI,
OPERA, FIREFOX, YOU NAME IT, BUT
THE APOSTROPH BECOMES FUNNY-LOOKING
IN EDGE WHEN EQUIPPED WITH ADOBE
ACROBAT.
NOTE THAT SOME OF THE REMARKS ON
HOW TO EDIT AND COPY CARDS IN THESE
PDF'S APPLY SPECIFICALLY TO THE
STANDALONE PC VERSION. SEE THE MOUNT
SECTION IN YOUR G15BR SESSION FOR INFO
ON THE EASY TO USE CARD EDITOR MADE
TO WORK PARTICULARLY WITH THE
G15BR BROWSER-FRIENDLY G15 PMN AND
SIMILAR VERSIONS LIKE G15BG.
To handle a warp, to put a new function
into an open slot:
mywarp=
^.
domywarp=
mywarp
lk
pf.
This sets it up. The running of 'domywarp'
starts the function that hasn't yet been
written, and which can be put into the
slot called mywarp, and which can be
replaced any number of times also during
program run. For instance, the helloyo
on top:
&helloyo&
ff
mywarp
kl
Next time we type
domywarp
We get
Hello world!
But if we do something like
nice=
&Try me!&
pp.
And then do, inside or outside a
function:
&nice&
ff
mywarp
kl
Then next time we type
domywarp
We get
Try me!
GOOD LUCK AND HAPPY LEARNING!!!
--Aristo Tacoma
berlinib@aol.com