Skip to content

grm-core 0.6.0: the GRM machine, written to, seen working, felt, in English or French

Choose a tag to compare

@innermost47 innermost47 released this 12 Nov 12:58
· 2 commits to main since this release

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: t tick, ld load, outs outputs, ins inspect, ms master, chk check, cap
      capacity, clk clock, h help, q quit, progs programs, rd read, o open, ed edit, sv save, st
      step, wt watch, uw unwatch, fc focus.
    • +/- can be written for ±, which is not on every keyboard.
    • Short forms and +/- work in files and at the prompt.
  • Help.
    • help lists every word by group, with its short form and a few words.
    • help WORD gives its form, what it is, an example, and for the main words a longer explanation.
    • tour is 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 grm and 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; !N types 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.
  • programs lists them, with what they do and with their inputs, outputs and networks, read from the program
    itself.
  • read NAME shows one here, its lines numbered.
  • new NAME starts one from a template that runs as it is. new NAME.ext makes a new file of any kind (a CSV,
    notes) in the folder it is in, open in a tab; new alone opens a tab with no name, and save NAME.ext names it,
    with the extension chosen.
  • run with no file runs the current tab.
  • The programs window:
    • open NAME opens 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 N or tab 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 and pause (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 a tick or play.

    • A new relation or a new measurement is left to the rounds, where it can be seen going through the network.
    • ask, why and inspect read the values as they are.
    • observe and forget on a node the machine already has are heard by that node in place, like put, 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 NODE stops when its value changes;
    • watch RELATION stops when it no longer holds.

    A watch pauses the clock and stops tick n (stopped after 3 of 10 ticks). watch alone 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. inspect and 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 the set as 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; !N types 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.

  • cd really moves the machine: use, load, run, open, read and new start from that folder. The machine's
    own programs are still found from anywhere. Tab completes paths.

  • load reads 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; focus alone 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, calm by
    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.wav writes 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 fr and lang en change 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 journal no 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".
  • tab with 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
    mood and of the panel follow the longest word of the language. The note under the t − n slider is no longer cut.

Docs

  • docs/GRML.md gains sections on programs, seeing it work, the help and the two languages.
  • docs/GRML.fr.md is 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.md and README.md say the same in short.

Inside

  • New modules:
    • vm/i18n.py: tr, label, colon and 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.tick is now begin_tick, then rounds, then end_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.layout takes a front.
  • grm_vm.read_table, grm_vm.number, grm_vm.name_of. Shell.history, Shell.is_long.
  • graph.table, graph.shown. A set keeps 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, help on 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, play and pause;
  • the helpers' names, and cards as tables;
  • folders and files, rm asking 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,
    history and !N, a warning in amber, n′ in equations;
  • all of it in French too.