Repository navigation
grm-core 0.6.0: the GRM machine, written to, seen working, felt, in English or French
The machine is programmed with relations, not steps, a new way of programming. This version brings:
- help where the typing is;
- a place of its own for programs;
- a way to watch a tick at work, stop it and ask why;
- folders and files as in a Unix shell;
- a focus on one network in the network;
- what the machine feels made perceptible: colours, waves, moments, a calm ambient sound, a logbook;
- the interface in French.
The language itself does not change: every 0.4.2 program runs as it is, and a whole tick gives the same values as
before.
Requires pygrm ≥ 0.5.1 (unchanged).
Writing to it
- Short forms and
+/-.- Every statement has a short form:
nd,rel,obs,fgt,kp,net,cl,lrn,inp,out. - So does every long command:
ttick,ldload,outsoutputs,insinspect,msmaster,chkcheck,cap
capacity,clkclock,hhelp,qquit,progsprograms,rdread,oopen,ededit,svsave,st
step,wtwatch,uwunwatch,fcfocus. +/-can be written for±, which is not on every keyboard.- Short forms and
+/-work in files and at the prompt.
- Every statement has a short form:
- Help.
helplists every word by group, with its short form and a few words.help WORDgives its form, what it is, an example, and for the main words a longer explanation.touris a guided tour in twelve steps, each with a line to type: relations both ways, time, learning,
programs, a tick step by step, folders and focus, what the machine feels.
- The prompt says
grmand the folder it is in (grm ~/projects/climate>): the human has the hand. - What was typed is kept from session to session (
vm/history.txt, next to the memory). Up and Down find it
again, in the window and in the terminal.history [N]lists it, numbered;!Ntypes line N again,!!the last. - As it was left, it comes back: the folder of the prompt, the network in focus, the program tabs and the one
chosen, the logbook if it was open, the sound if it was on, the clock, the sashes (vm/settings.json). - A warning is amber (
⚠), an error red (!): a warning is something worth knowing, not something broken. - Under the prompt, in the window, one line says what is being typed: the word, a few words on it, its form. It
always takes two lines, so the prompt never moves. - The menu of words is a tooltip.
- It floats above the prompt, under the word being typed.
- It offers words of the machine from the first letter, with their short forms.
- It offers names of nodes and relations from the second letter, and only when there are no more than twelve of
them. - Up and Down choose; Tab, Enter or a click takes; Esc closes.
- A folder taken (
programs/): what is in it is offered at once, the first one chosen. - It is optional: a box under the prompt, or
help on/help off.
Programs
- A program can begin with a header:
#! name,#! does,#! try. Every example has one. programslists them, with what they do and with their inputs, outputs and networks, read from the program
itself.read NAMEshows one here, its lines numbered.new NAMEstarts one from a template that runs as it is.new NAME.extmakes a new file of any kind (a CSV,
notes) in the folder it is in, open in a tab;newalone opens a tab with no name, andsave NAME.extnames it,
with the extension chosen.runwith no file runs the current tab.- The programs window:
open NAMEopens a program in a window of its own, one tab per program, with line numbers and the colours of
the prompt.- Everything is done from the keyboard. Commands:
tab Nortab NAME,edit,save,find,close. - Keys:
- Ctrl+S saves;
- F5 runs the tab line by line, and a line that fails turns red;
- Ctrl+F searches;
- Ctrl+Tab goes to the next tab, Ctrl+W closes one;
- Esc goes back to the prompt.
Seeing it work
A tick is a conversation in rounds: the nodes that heard something new tell their relations, the relations answer,
until nothing new is said.
-
Play, pause, a tick, a round.
-
play [HZ](F8) starts the clock andpause(F8) stops it. A tick is F10. -
step [n](F11) runs n rounds, one at a time. Each round says which relations worked and which nodes moved,
from what to what. The end of each tick says its rounds and its writes:tick 2, round 1: the measurement of t worked tick 2, round 2: fall worked; moved: t 2 -> 3 tick 2, round 3: no relation worked; moved: height 19.62 -> 44.145 tick 2 done in 3 rounds
-
-
Step by step. From the first
step, nothing runs but a round at a time, until atickorplay.- A new relation or a new measurement is left to the rounds, where it can be seen going through the network.
ask,whyandinspectread the values as they are.observeandforgeton a node the machine already has are heard by that node in place, likeput, instead of
building the machine again.- Outside step by step, the machine settles at once, as before.
-
Watches (breakpoints):
watch NODE in LO .. HIGH [and ...]stops when the condition becomes true;watch NODEstops when its value changes;watch RELATIONstops when it no longer holds.
A watch pauses the clock and stops
tick n(stopped after 3 of 10 ticks).watchalone lists them;unwatch
takes them away. -
why NODE: the messages a node hears, each with its share, what it says, and what that relation heard from its
other nodes. A node's value is what all its relations say of it, each weighted by how sure it is. -
In the window:
- buttons: ▶ / ⏸, a tick, a round;
- a line says where the machine is (
paused · step by step · in tick 2, round 2 · 1 watch); - the relations that worked in the last round are framed;
- when a watch is met, the clock pauses.
-
Cards are tables.
inspectand the mouse over a node or a relation give the labels, dim, on the left, and the
values on the right, with a line between the two columns. -
The machine's own helpers are named for a human. The node that holds the next value of
n(n__next1) is
"next n". The relation that computes it (set_n_1) is "set n", and its text is thesetas written. Tab and the
menu do not offer them.
Folders and files
-
clear(Ctrl+L in the window) clears the words from the screen; nothing of the machine is forgotten.touch FILE
makes an empty file. -
history [N]lists what was typed, sessions before included, numbered;!Ntypes line N again,!!the last. -
pwd,cd(..,~,-, Windows paths),ls [-l] [-a](folders, programs and data in their own colours,
wildcards),head/tail [-n N],cat,mkdir [-p],cp [-r],mv. -
rm [-r]asks first, in red:delete data.csv? (y/n)(supprimer data.csv ? (o/n)in French). Nothing goes
without yes; a folder needs-r. -
cdreally moves the machine:use,load,run,open,readandnewstart from that folder. The machine's
own programs are still found from anywhere. Tab completes paths. -
loadreads a CSV from any program:- UTF-8 with or without BOM, or Windows' encoding;
,,;, tab or|as separator;- decimal commas, thousands separators, percentages.
Before, a CSV saved by a French Excel (
;,3,14, cp1252) failed to load or lost its values in silence. A header
that is not a name (Température (°C)) becomes one (Temperature_C), and the machine says so. -
Long work runs aside: a file, a night,
use,run, many ticks. In the window, the line under the prompt turns
into a wheel with how far the work is ([████······] 400/1000 rows), and the window stays alive. In the terminal,
the same at the start of the line.
Focus: a network in the network
- The machine remembers, with its memory, which nodes and relations each network in the network brought: a program,
a call (circle(small)), a file of data, the base, what was typed, what it found by itself. focus NAME,focus node N [depth],focus relation R,focus between A B...,focus all;focusalone lists
them.- What is in focus comes to the front:
- the picture zooms on it, easing there;
- its nodes and relations draw together;
- what touches it stays in a second plane, smaller and fainter;
- the rest fades into a third plane, with no names.
- It goes by itself to a program used or run, a file loaded, a tab chosen in the programs window. Step by step, what
works comes to the front too. - In the window, a pill per network above the picture: a click brings it to the front.
Feeling it
What the machine feels is made perceptible, and every light, movement and sound is one of its real quantities:
-
seen (
senses, the ◐ button): small lights going along the links (the messages of the relations that worked),
a soft halo around a relation (the information it brings), a slow ripple (a surprise), a light a little warmer or
colder (pleasure, displeasure). Nothing moves when it has settled.senses off | calm | present | vivid,calmby
default;senses motion off,senses colour off; -
moments: a relation found by itself comes as a card: its law, a sentence (
when t doubles, h is multiplied by 4,wave swings: it comes back every 25 moments), the points it was found in, its r². A surprise has its card too.
They come in and go slowly; a click closes them; -
heard (
ambient, the ♪ button and its ▾ menu): a slow, soft, new-age-like sound in real time, with a long reverb.pad: a voice a relation, tuned on the harmonics of one note; a relation that does not hold beats against the
others, and the beat is its disagreement;engine: a low hum whose pulse follows the machine's work;wind: a breath.
Pleasure opens the higher harmonics; a discovery rings a soft bell on an interval taken from its law (t²: the
octave); a surprise swells and settles. A low drone holds a C, its octave and its fifth under it all, as a tanpura
does. Each network has its own key, with its colour, low and in tune with the others: when another is looked at,
the sound glides to its key over a few seconds. The mixer (♪ ▾): volume, ambient, drone, bells, reverb
(ambient drone 30%). Off unless asked, or on again if it was left on. It needs sounddevice;ambient save FILE.wavwrites it without. -
colours: each network in the network has its soft colour, the same as its pill: a territory under its nodes,
its links and relations tinted, its plain nodes wearing it. The base is slate, what it found is gold, what was typed
lilac; the network in focus glows a little more. Amber and red stay for what does not hold; -
waves: the picture moves gently with a sea swell (a wave every 10 s; each point turns on a small circle, as water
does under a wave), breathing with the sound when it plays, rising with a surprise (senses waves off); -
the logbook (
journal, the ✎ button): what it lived, day after day, written to be read. When it woke, the
programs and files it was given, what it found (the law, a sentence, the points drawn), what surprised it, what each
night kept or forgot, with the day's summary. Kept with its memory, read in the language of the machine, searched
(journal WORDS); in the window, in a window of its own; -
the ring around a node that has just moved fades slowly (2.5 s) instead of flashing;
-
calm by design, for everyone, autistic people included: nothing flashes, every change is slow, the sound is
capped, starts in silence, and has nothing above a few kHz. Everything can be turned down or off, and is
remembered.
The window
- Two columns: the words on the left, wider; on the right, the network, with inside and the outputs under it.
- It opens on the whole screen, with the panel under the network already open.
- The sashes between the parts show a grip, so it is plain they can be dragged. Where they are left is kept
for the next time (vm/settings.json). - The buttons ▶ / ⏸, a tick, a round are larger and lit: ▶ in amber, the others light on slate. Beside them, a
little apart: ♪ the sound (and its ▾ menu: the ambient, the volume) and ◐ how strongly the senses show.
English and French
lang frandlang enchange everything the machine says: answers, errors, help, the tour, the window, the cards,
the master equation.- At the first start, it follows the language of the system.
- The words of GRML stay English in both, so a program runs anywhere.
- The French uses French typography ("erreur : ") and says "passe" for a round, so as not to be read as
tour, the
guided tour. - The choices are kept in
vm/settings.json, next to the memory (ignored by git).
Fixed
- Opening the logbook from its button no longer gives the focus back to the prompt, and
journalno longer writes
its entries in the words when its window shows them. - The master equation writes the next value of n as n′, not with the machine's own helper (
room′, not
room__next1). - A file saved from a tab no longer ends with an empty line too many.
- The mixer stays above the machine's window: a slider let go no longer sends it behind.
- In the ♪ and ◐ menus, what is chosen is marked (a lit dot, lit ticks); it was invisible.
- In French, an error of the machine was not felt as displeasure. The check looked for the English word "error".
tabwith no tab open says so. Before, it printed an empty line.- In the window, the legend measures its words and goes onto a second row when it does not fit. The columns of
moodand of the panel follow the longest word of the language. The note under the t − n slider is no longer cut.
Docs
docs/GRML.mdgains sections on programs, seeing it work, the help and the two languages.docs/GRML.fr.mdis the whole of it in French. The outputs it quotes were run in French.- New pictures:
docs/grm_vm_window.png(the window),docs/grm_vm_panel.png(under the network),
docs/grm_vm_logbook.png(the logbook). vm/README.mdandREADME.mdsay the same in short.
Inside
- New modules:
vm/i18n.py:tr,label,colonand the settings;vm/fr.py: the French catalogue;vm/guide.py: help and tour;vm/programs.py;vm/debug.py: watches, the report of a round,why.
runtime.Machine.tickis nowbegin_tick, then rounds, thenend_tick.vm/files.py: folders and files.vm/journal.py: the logbook.vm/senses.py: what the machine feels, and its moments;vm/ambient.py: the ambient sound and its reverb.VM.step,VM.stepping,VM.settle,VM.peek,VM.watches,VM.focus,VM.join,net.groups(remembered).graph.groups,graph.focus_keys,graph.planes;graph.layouttakes a front.grm_vm.read_table,grm_vm.number,grm_vm.name_of.Shell.history,Shell.is_long.graph.table,graph.shown. Asetkeeps its text.
Tests
vm/test_vm.py 104 (47 new), vm/test_universe_unbiased.py 14, talk/ 10; the whole repository 241. The new tests
check:
- short forms,
+/-, program headers,helpon every word, every line of the tour; - that the French catalogue is whole: every text the machine may say, found in the code, with the same fields;
- the language switched and remembered, the line and the menu;
- a tick a round at a time gives the same values as a whole tick;
- step by step after a measurement and after a new relation;
- watches,
why,playandpause; - the helpers' names, and cards as tables;
- folders and files,
rmasking first (in English and in French); - a CSV from a French Excel;
- what was typed kept from session to session;
- the networks in the network, every kind of focus, the front drawn together, groups remembered;
- what it feels, a discovery and a surprise as moments, a strain heard as a beat, the ambient sound calm (capped, no
sudden start, no click, nothing sharp); - the logbook (each moment, the night's summary, remembered, read in French, searched), the colours of the networks;
- the mixer and the drone, a key for each network (gliding), the state kept for the next time, a new file of any kind,
historyand!N, a warning in amber, n′ in equations; - all of it in French too.