Repository navigation
grm-core 0.5.0: writing to the GRM machine, with help at hand, in English or French
The machine is programmed with relations, not steps, a new way of programming. This version puts help where the
typing is, gives programs a place of their own, and lets the interface speak French. The language itself does not
change: every 0.4.2 program runs as it is.
Requires pygrm ≥ 0.5.1 (unchanged).
New
- Short forms and
+/-. Every statement has a short form (nd,rel,obs,fgt,kp,net,cl,lrn,
inp,out), and so does every long command (ttick,ldload,outsoutputs,insinspect,msmaster,chk
check,capcapacity,clkclock,hhelp,qquit,progsprograms,rdread,oopen,ededit,sv
save).+/-can be written for±, which is not on every keyboard. Both work in files and at the prompt. - Help.
helplists every word by group, with its short form and a few words.help WORDgives the word's form, what it is, an example, and for the main words a longer explanation.touris a guided tour in ten steps, each with a line to type: relations both ways, time, learning, programs,
what the machine feels.
- Under the prompt (window):
- one line says what is being typed: the word, a few words on it, its form;
- under it, a menu of words from the first letter, with their short forms. Names of nodes and relations appear
from the second letter, and only when there are no more than twelve of them. - Up and Down choose, Tab or Enter takes, Esc closes.
- The menu is optional: a box under it, or
help on/help off.
- Programs.
- A program can begin with a header:
#! name,#! does,#! try. Every example has one. programslists the programs 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.runwith no file runs the current tab.
- A program can begin with a header:
- The programs window (window):
open NAMEopens a program in a window of its own, one tab per program, with line numbers and the same colours
as 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 (Enter for the next match, Shift+Enter for the one before);
- Ctrl+Tab goes to the next tab, Ctrl+W closes one;
- Esc goes back to the prompt.
- An error in a file opened in a tab marks its line there.
- English and French.
lang frandlang enchange the language of everything the machine says: answers, errors, help, the tour,
the window, the cards under the mouse, 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 written in one runs in the other.
- The choice, and that of the menu, are kept in
vm/settings.jsonnext to the memory (ignored by git). A machine
without memory, as in the tests, neither reads nor writes them.
- Docs.
docs/GRML.mdgains a section on programs and the programs window, the short forms, the help and the two
languages.docs/GRML.fr.mdis the whole of it in French. The outputs it quotes were run in French.vm/README.mdandREADME.mdsay the same in short.
Fixed
tabwith no tab open now says so (it printed an empty line).- In the window, the legend measures its words instead of guessing their width, and goes onto a second row when it
does not fit. The columns ofmoodand of the panel follow the longest word of the language. The note under the
t − n slider is shorter, so it is no longer cut.
Inside
vm/i18n.py:tr(template, **values). Every text the machine says is an English template, andvm/fr.pygives it
in French with the same fields. A template missing from the catalogue is said in English.label()writes a word
with its colon as each language does ("error: ", "erreur : ").vm/guide.py(help, tour),vm/programs.py(find, header, listing, template).vm/editor.py:DOCS(form, a few words and an example for every word), the short forms,hint()andsuggest()
for the line and the menu under the prompt.
Tests
vm/test_vm.py 67 (10 new), vm/test_universe_unbiased.py 14, talk/ 10; the whole repository 203. The new tests
check:
- the short forms and
+/-; - the headers of every program, and
programs,readandnew; helpon every word, and that every word is in one group;- every line of the tour run on a machine born with its base;
- 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 under the prompt;
- the colon in each language.