## A work journal about the Pep/Nom system A journal of work carried out on pep and nom. Here I make notes about work I am carrying out on the [pep] and [nom] system. (September 2019 seems to be the date that I finally had a decent implementation in 'c'). This file shows a long litany of programming work carried out, a lot of it in Colombia probably because time goes slower in that country. Comments, suggestions and contributions to *mjb at nomlang.org* This document serves as a catch-all for 'to do' lists and lists of ideas to implement. ### 7 dec 2025 working on the /eg/machine.snippet.tohtml.pss which appears to be more or less working now. Now I need to add it to the blog.mph functions which generate the html for this website. After this I plan to work on /eg/text.tomarkdown.pss so that I can generate a markdown version of the documents here, and hopefully soon generate a book with some document system such as quarto: or typst: Below is a rudimentary example of what I would like to produce (this is generated by machine.snippet.tohtml.pss ) But this needs better formatting. * an example machine diagram -----= Partial Program Listing (size:400 ip:0 cap:20000) 0> while [class:space] 1: clear 2: testeof 3: ++ 4: -- 5: replace [text:x] [text:y] 6: jump [int:0] --------- Machine State ----------- (Buff:0/39 +r:0) Stack[word*space*] Work[the ] Peep[EOF] Acc:324 Flag:FALSE Esc:\ Delim:* Chars:132450 Lines:1862 --------- Tape -------------------- Tape Size: 500 0/10 ) 0 [within { and } >>>>] 0/10 ) 1 [:starting:] (m:first) 0/10 ) 2> ["the end delimiter"] ,,,, ### 4 dec 2025 I had some interesting ideas about an image manipulation chat script called /eg/chat.images.pss which I havent written yet. My idea is that I should just start out by writing down some of the phrases that I would like the script to respond to, and then work out the grammar and semantics from there. * So I could write ------- "convert all to jpg" "crop big images to a square" "big means|is 100K" ,,,, Then I could write underneath how I think the chat-script should parse these phrases according to its *Tiny Language Model* For example * "convert all to jpg" ------ command*set*to-clause* ,,,,, Also another good idea is using a "todo" state variable which contains a command that was previously constructed from context. Here is an example dialog: * dialog ---------- user: convert all images cs: to what format would you like to convert them? user: png (set todo="convert to png") # then execute the todo state variable on the next iteration of the script ,,,, The idea of all this is to allow the user to interact 'expressively' with the objects (in this case image files). So the user *expresses* his or her intention and the script works it out. ### 3 dec 2025 I feel, rather grandiosely, that nom should be promoted at conferences such as splashcon: or gophercon: or at POPL and other places because I dont think people are going to get enthused while randomly trawling the web. A Bogota street musician called bayron.celis: played a song called 'Maracas' by some mexican artist. And he told me about guitars called 'Bucaramanga' which are made in that city. random link: the arduino car robot with bluetooth. https://projecthub.arduino.cc/fractaltech/create-your-own-2wd-arduino-robot-with-bluetooth-control-6f6391 ### 2 dec 2025 j After some cursory investigation, it seems that quarto: and typst: and maybe even just markdown + pandoc: could be sufficient for publishing a book about the pep/nom system. In which case, the top priority should be cloning the text-to-html script, and making markdown the target. ### 1 dec 2025 * another list of things to do, in order - make sublists for /eg/text.tohtml.pss eg: -- will start a sublist and continue it. But really this will just be a 'second level' list. - make the script /eg/text.totoc.pss which will be a 'preprocessor' for text files which contain sets of headings. This will convert the headings into tables of contents, using the same techniques in /eg/toc.pss (i.e. multiple [toc] labels are allowed) and it will use lists (-) and sublists (--) to render these tables of contents. - make the /eg/machine.tohtml.pss or /eg/machine.snippet.tohtml.pss insert pep machine diagrams in text. The problem is that the nom://system command is failing in some circumstances in the pep interpreter, so I cant do a >> write; clear; add "pep -f eg/machine.tohtml.pss sav.pp"; system; print; to insert the diagram in the text. And machine.snippet.tohtml.pss needs to be modified (eof becomes 'when the end of block is reached') - another option is to use the perl translator to render these machine diagrams - start writing the latex or epub code. or write a texta-to-markdown script and then just publish from markdown - try to actually create the nom book from the docs on the website and also new text. ### 30 Nov 2025 Encountered a difficult segmentation fault after recompiling the pep interpreter. The script /eg/text.tohtml.pss is producing a segmentation fault on start-up before it even begins to start parsing. Strangely all other scripts seem to be working normally. Valgrind tells me that this occurs at /object/pep.c line: 2314 * the problem ------ if (inlineScript != NULL) { // ... fputs(inlineScript, temp); // ... } ,,,, which is just saving the inlineScript given to the *-i* option to a temporary file. But this code should never be executed because it happens even when there is no inline script. So inlineScript should be NULL. I suppose this pointer is getting corrupted somehow. ### 29 Nov 2025 Was working on a script to insert pep-machine diagrams into the /eg/text.tohtml.pss output. This would have been very similar to the task that /eg/nom.snippet.tohtml.pss carries out, but I realised that it is much simpler to user the nom://system command to insert the output of /eg/machine.tohtml.pss into the html output at the correct place. This has a big advantage of not requiring an extra *snippet* script for this job. ### 28 Nov 2025 The example script /eg/chat.timeline.pss has got to a useful stage and the concept of using nom in a kind of *chatbot* environment has proved interesting. Another idea is to integrate calls to some AI engine, such as gemini. Also, fixed a utf8 problem in the perl translator (stdin was not set to binmode utf8). Added [-_.] to identifiers in /eg/xml.parse.pss ### 27 Nov 2025 I became bogged down on the /eg/chat.nom.tr.pss and took a quick break from it. I will now start a new 'green-fields' chat script called /eg/chat.timeline.pss which will be a chatbot for managing the *timeline* scrip * current projects and idea - make /header and /footer and /makepage for /eg/text.tohtml.pss - make a [toc] table of contents *pre-processor* for the /eg/text.tohtml.pss script. This - add [.-_] as acceptable characters in identifiers in the /eg/xml.parse.pss script. I realised, in a moment of lucidity, that all I need to do to add these characters is create a few new grammar rules such as: "id '.' id -> id" and "id '_' id -> id". I think that I have an instinctive aversion for parsing *character-by-character* with nom, because I think it will be slow or difficult, but it isn't either. - develop my app-super-language idea: from writing a flutter/dart app is has become evident that lots of the coding is very "routine". Even the creation of the widgets seems somehow formulaic and repetitive. This led to the idea of a simpler language written in nom which would remove a lot of the hack-coding. - nom chatbots: this seems a very fertile field for exploring, because it is applicable in many contexts. * format of the app-super-language -------- # create a data 'list' screen with a search box search-list { name: phrase-list; # becomes 'phraseListScreen' in generated code loader: phraseLoader; # this implements an interface DataLoader source: on-item-click: push phrase-detail; } widget { name: phrase-detail; a: button { text: "one"; icon: edit; on-click: push edit-phrase; } b: button { text: "two"; icon: settings; on-click: push app-settings; } # this is a visual layout of the UI elements that are given above. # it seems to be more intuitive to me, than huge nested lists of Row() # and Column() but the idea is experimental. ".." means new row. I dont # know how to do columns layout: .. a .. b ; } ,,,, The above sketches some ideas from a language implemented in nom. The parsing and compiling phrase is fairly simple- in fact, the point of the language is really just to save typing. It should allow functional, 'vanilla' apps with a minimum of coding. Even the model classes should be automatically created based on the example JSON text data which is supplied. The json text data could contain hints about the data types etc. ### 25 Nov 2025 More ideas and work: In general the chat-loop or chatbot idea for use with nom has shown much promise. I have been working on an example script called /eg/chat.nom.tr.pss . This is a direct adaptation of the script /eg/nom.to.pss which works by accepting a 'plain' English request or command (with a very limited vocabulary and grammar) and producing the correct bash commands to translate a nom script into various other languages. The chat-loop version of this provides a script loop written in ruby, which accepts input from and feeds that input into the nom script. State is maintained via a *properties* text file in the format ---------- file= language= that= # etc ,,,, ** ideas ** - a /eg/ language.list.txt this can contain words in English categorised by parts-of-speech (adjectives, articles, nouns etc) along with one word translations into various languages. - annotations above or-list-tests to allow better self-documentation of scripts. - get ruby to pass "goodbye" etc to the nom script, and then exit afterwards. - make a new english parse-grammar script based on the one the /eg/ folder. - allow inserting file lists in html output of /eg/text.tohtml.pss by inserting a marker such as [filelist /eg/] This would use the nom://system command to insert the output of a different nom script: such as /eg/doc.marker.tohtml.pss (not written yet) * using the system command to insert an html file list ------- "word*word* { clear; get; "[filelist" { clear; add 'pep -f "$PEPNOM/eg/doc.marker.tohtml.pss" -i "filelist '; ++; get; --; add '"'; system; print; } } ,,,, This /eg/doc.marker.tohtml.pss script could handle various sorts of markers. It would probably be better to use a parse-token list like >> "[*word*file*]*" { ... } * an example of an 'annotation' about a language list ---------- #: languages "ruby","java","dart", "python","rust","zig" { # ... more code } ,,, ### 23 Nov 2025 I have been experimenting with adding a chat-loop to the nom script /eg/nom.to.pss The idea is to create a loop that prompts for, and feeds queries or commands to the script (which is designed to help translate nom scripts to other languages using a simple English prompt.). One problem that I have found, is that the messages emitted by nom.to.pss are not very *chatty* , or are not appropriate for a chatbot environment. Another issue is that I have a lot of logic (such as testing for the existence of the file to translate) in the bash script which is generated by the nom.to.pss script. This is okay, but I am wondering if it would be better to put that logic in the nom script itself (using the nom://system ) command. This goes against my idea of keeping nom as a purely parsing/recognising/compiling language, but in this context, it seems more logical to put the code into the nom script. * create a ruby chat loop from the nom.to.pss script (this makes test.rb) >> pep -f eg/chat.nom.tr.pss -i //makechat * then run it >> ./test.rb One of the points of this chat loop is to maintain *context* , that is, the context of the conversation. It occurs to me that I can do this simply by reading the state file, and generating parse-tokens from this state file, based on the data recorded there. Below is a conceptual example: * including context in Nom scripts running in a chat-loop ---------- # read state file with system add 'sed -n "/^server=/{s/^server=//;s/ *$//;p;}" chat-state.txt 2&> /dev/null'; system; # the server state variable is set so make a parse token !"" { put; clear; add 'server*'; push; .reparse } ,,,, Another important idea is the "maybe*" parse token which serves to indicate that the user should approve a particular action. For example: * a sequence of parse tokens for approval ------ "maybe*action*file*language*" { clear; ++; add "Shall we "; get; ++; add " the file "; get; add " to the "; ++; get; add " language?"; --; --; --; print; # now get a response with the system command, and exit if # 'no', but if 'yes', remove the 'maybe*' token and re-parse # brilliant! } ,,,, ### 22 Nov 2025 I put all the essential pep files on github at https://github.com/pepnom/pep So now the pep system can be downloaded with: * download pepnom >> git clone https://github.com/pepnom/pep Also, I have been thinking about having a *grammar-centric* view of software, which I think has potential. Please see the "blog" www.nomlang.org/blog/ for a development of this idea. ### 26 Oct 2025 I have been working on a language phrase tutor in dart/flutter and haven't done any more work on pep or nom. I did have the idea to create a nom script to generate flutter apps. This would be a parsing experiment where the input would be a json-like format (maybe with less quotation marks). The output would be a set of dart screens each reflecting an object in the input format: * an example of the input format for the nom to flutter script ---------- screen.user-details { text: "Please enter your details below", textbox: .... } ,,,, But this is pretty similar to the flutter format any way. ### 13 Oct 2025 I haven't been working on the Nom system but have been working on the "four apps" in Dart and Flutter that I mentioned elsewhere. I will probably use Nom parsers and renderers in those apps after translating them to dart. My work on nom is currently stopped at the stage of creating the AI code translation script which was only just begun. It would be handy to create new nom translation scripts like those at www.nomlang.org/tr/ Also, I would like to add the machine diagrams to the website. The /eg/machine.tohtml.pss script I think is reasonably good but it has to be integrated into /eg/text.tohtml.pss (using the same techniques as is used for code listings). Also I would like to create a latex equivalent of /eg/text.tohtml.pss so that I can actually create a printable book of some of the nom documentation. I feel like if I am able to do that I will feel like I have really "achieved" something with pep/nom . Also I could send the books to people. ### 28 Sept 2025 I have been having a mini-break from the www.nomlang.org system. But the major tasks that I would like to finish are the AI translation helper script, which I have started by can't remember what I called it. The idea was just to allow easy AI (Gemini etc) translations of the translation scripts in /tr/ so that many other translation languages can be added to nomlang. Other important tasks for the advancement of nom and pep. - add machine diagrams to the documentation with /eg/machine.tohtml.pss - make the nom -> latex translator - make a nom book and print it off. ### 1 Sept 2025 Idea: A nom self-test script for example -----+ clear; add "abc" !"abc" { ...error } unescape "a"; !"abc" { error } # and so on. ,,,, This is called /eg/self.test.nom.pss at the moment and is in a very incipient phase. It has the weakness that the script needs to assume that some syntax or commands do initially work (such as nom://print and tests and nomsyn://block s etc) Idea: a translation template that can be fed into an AI engine to generate new nom translators. This would be based on the lua/perl or dart code, or which ever is the currently best translation script. And it would allow the automatic generation of the new translation script. This translation template consists of 2 parts: the code that needs to be translated, including the pep machine class and methods and the main() method with command line switches. This code also includes the snippets that implement the commands such as nom://add Above each snipped will be a special comment line, that will allow a nom script or bash script to extract that snippet from the (AI) translated code and insert it into the template. This first file is the code that will be translated by an AI engine and the code will be based on a good existing translation script (eg perl or dart). The second part is the template itself which contains place-holders for the snippets and the machine class and methods. Then we require some script or code to combine the two parts to create the translated translator. The second part could just be a nom script but it would have to rely on the order of the snippets. Or I could rely on the nom://system command to insert the found translated snippets into the template file * how to parse the translated code with nom ------+ # read line by line or word by word # the snippet file will have the format # (comment syntax in target language) add-snippet: # (code to add to workspace in target language) eg: this.work += '; get; # so the previous line indicates what is coming next # Tokens: line* lines* nl* snipname* parse> pop; pop; "line*line*","lines*line*" { # maybe add the nom add command and quotes here ? clear; get; ++; get; --; put; clear; add "lines*"; push; .reparse } "nl*text*word*","nl*word*word*" { clear; ++; ++; get; --; --; "snippet:" { replace "-snippet:" ""; put; clear; add "snipname*"; push; .reparse } } # maybe need a lookahead token? so that we know when to call # the system command to insert into the template file - # or build the 'sed' command now ? B"snipname*line".!"snipname*line*".!"snipname*lines*" { replace "snipname*lines*" ""; replace "snipname*line*" ""; push; --; add "sed -i 's/'"; get; add "-snippet:/ ++; # build a sed inline replace here? or build the new translator # I think build the new translator here in this script is better. # but the snippets need to appear in the correct order... # transfer the unknown token attrib here ... } ,,,, Made an inline interpret switch for the nom.toperl.pss translator. ### 31 August 2025 Made the interpret() method of /eg/nom.toperl.pss work, with minimal testing. It is hard to believe that it works but it does. The important tasks for pep and nom seem to me to be: todo! - add self script interpretation to /eg/nom.tolua.pss as well as the self help system. - debug the perl translation of /eg/palindrome.pss - write a resetMachine() method for /eg/nom.toperl.pss and also the other scripting languages, because it is handy for running in interpreter mode. (done for nom.toperl.pss) - fix the segmentation fault bugs in the pep interpreter (done?) - rewrite the nom compiler /compile.pss so that it uses the new grammar and script organisation from the more recent translation scripts. - write a better download script and a better way to update the downloadable files - fix the old translators - or update them - add better self-help, self-translation and self-testing to the nom translation scripts. - fix class illegal escape chars in the translators - write a text to latex translator - update and rewrite the /eg/toybnf.pss script so that it can lex as well as parse - write a tr/nom.toforth.pss translator to translate nom scripts into the forth language (with DIY memory management). - write translators for zig, julia, R. - write an example type-checker, initially with no scope and just a limited number of variables. This could form the basis of a more comprehensive and realistic type-checker which is an important hurdle for nom to be 'taken seriously' in the field of programming language construction (or compiler construction). - revise the meaning of [:blank:] in pep and the translation scripts. This should mean any white-space character except the "\\n" newline character?. No, I think it is only space and tab. This may be its most useful definition because it allows easy line-by-line parsing. I think "\\r" can be safely ignored. This maybe a pathway to "finishing" my work on pep/nom, or at least getting to the stage where I feel that this system could be presented at a conference with some level of confidence. None of these tasks seems greatly insurmountable, but rewriting the older translation scripts (such as java, tcl, c, ruby, python) is a time-consuming task, even with the help of a LLM translator such as google gemini. ### 30 August 2025 Looking at the interpret() method in the /eg/nom.toperl.pss nom -> perl translation script. Fixed a small bug in the input switches. Probably would be good to add the help system to the translation scripts, which could also be used to create 2nd Generation scripts with a help word like /gen2. This would create the parser parser, and maybe run the input script. This system could use the /eg/nom.to.pss script to generate the translator with itself. ### DONE - made the interpret() method work in /tr/nom.toperl.pss This is pretty remarkable, if I say so myself: its a translated translator that is interpreting itself. - changed the nom://quit command to return the number in the accumulator as the exit code. This allows scripts to act as pure 'recognisers' for patterns and formal languages, meaning that they only return zero if the input is a valid *sentence* in the given language, or a non-zero value, if not. - seemed to have fixed the nom://restart and .reparse bug in nomsyn://begin blocks for the perl translator. - added the *system* command to the pep interpreter. Need to add to the translation scripts. - implemented nom://system command ... ### 29 August 2025 Working on segmentation faults and memory leaks in the pep interpreter. The 'until' code in the interpreter is bad, but that may not be the only problem. I may have fixed the nom://until code and nom://untiltape code but valgrind still complains about unitialised value at line 560 in /object/machine.interp.c in the strcmp() function. I think this is because for some reason the instruction ii->a.text parameter is not valid. ### 26 August 2025 Added the accumulator as an exit code for the nom://quit command to the pep interpreter. Desultory testing. ### 22 August 2025 Working on /eg/machine.tohtml.pss which is supposed to create a nice visual (html) representation of the pep machine, tape and (compiled) program listing. I am not sure of the point of this massive ongoing coding effort, but the system still seems potentially revolutionary. ### 13 August 2025 Did lots of interesting work on /eg/timeline.tohtml.pss Added self-testing and translation and reformed the grammar. The token reduction technique in /eg/timeline.tohtml.pss is really quite amazingly good. It gets rid of, or 'evaporates' component parse tokens when they are out of context, meaning that they dont form part of the larger pattern. This technique is much more flexible and succinct than previous methods I have used, and will become a standard parsing technique. It also means that there is no reason not to add lots of new parse tokens (eg for punctuation) because it is easy to get rid of them when they are not longer wanted. Started to add the self-help, self-translate and self-test to the script /eg/grammar.en.pss which is an adaptation of /eg/natural.language.pss Also, improved the self-testing in /eg/text.tohtml.pss but I am starting to get lots of segmentation faults when I add to this script (which is now pretty big). These are thrown by the *pep* interpreter (which is written in plain 'c' so that is probably not surprising). I need to hunt down what is happening. I tried to make file links appear as style. So /eg/index.txt should look use a code font and so should /tr/index.txt ### 11 August 2025 Also adding all the selfs to /eg/maths.parse.pss and it all seems to work nicely, including creating and opening a pdf from a random test input with the help word /test.line.pdf Added self-translation, self-testing, and self-help to the old script /eg/json.check.pss It seems to be working well and is now probably the model to copy for adding this to other scripts. With a simple phrase like >> pep -f json.check.pss -i /toall We can translate this script to all the available nom translation languages (eg [nom:tr.links] ) But that is not all! We can also reformat to latex/pdf/html with *pep -f json.check.pss -i /topdf etc* This is possible because of the script /eg/nom.to.pss and because of the different translation scripts and formatting scripts in the /tr/ and /eg/ folders. ### 10 August 2025 working on the 'all' method for the script /eg/nom.to.pss which translates a nom script to all languages for which there is a translator. It appears to be working. ### 9 August 2025 Some ideas for the system: - nom://until with multiple end delimiters - a horizontal list format using css for succinct lists - change the nom home page to "what is nom?" and "what can nom do?" - change example script. ### 4 August 2025 wrote the script /eg/tocfoot.tohtml.pss which demonstrates adding a table-of-contents and a footnote list to a document using markers such as [toc] and [foot]. The script is a variant of /eg/toc.tohtml.pss but is much better because the index lists can be placed anyway in the document with the markers, and they can also be repeated. The script uses the same technique of building the lists in nom://mark ed taped cells at the top of the pep://tape . * example to detect ## starting a line ----+ read; "#" { while [#]; B"##" { clear; pop; "nl*" { push; until "\n"; put; clear; add "heading*"; push; .reparse } # '##' doesnt start the line, so its just a normal word. push; whilenot [:space:]; put; clear; add "word*"; push; .reparse } } ,,,, The pep interpreter still throws the occasional segmentation fault when adding stuff to the /eg/text.tohtml.pss file I wonder if that has to do with program size limits? Because that script is pretty big now. ### 3 August 2025 I wrote the script /eg/nom.to.pss based on the code in /eg/xml.parse.pss . I could also make this a testing script as well using the existing code. This script responds to very simple sentences like 'translate eg.pss to ruby' or 'to ruby eg.pss' The advantage of having this script, is that I can now include it in the help system of all other scripts in order to provide 'self-translation' Thinking about the etymologies idea for the text to html formatter, but I would like to style the pop up to display the etymologies in 2 columns. Ideas and things to do. - add multiple end delimiters for nom://until * example >> until ")","\n"; This is useful when the end delimiter of a pattern is more that one character. The nom://while command can do that but then you have to nom://read the extra character and consume it. This introduces problems with *reading* on EOF (which will exit silently and cause considerable head-scratching when you are trying to debug). - write the nom://system command. This needs to be put into the pep interpreter and all the translators - fix the perl translator /tr/nom.toperl.pss so that it can become an interpreter and then use that code as a model for ruby, python etc. ### 2 August 2025 Added a ligature for ae words like aeroplane or gynaecology. archaeology,and julius caesar. Experimenting with substituting ligatures for character sequences in /eg/text.tohtml.pss not for any practical purpose I can think of. * bandjalang words with the ng character ------ "yolngu" "yolŋu" this is a phonetic spelling for the australian language which is used in some texts..and Bandjalang. yuŋga - to go, to walk jaŋga - to sing muŋga - to sleep ŋuŋgi - to sit ŋali - we (dual, including the person being spoken to) ŋa:wih - a long way ŋari - a person, a man ŋami - a mother ,,,, * some greek etymologies ---- Academy" "Ακαδημία" "Acoustics" "Ακουστική" "Acrobat" "Ακροβάτης" "Alphabet" "Αλφάβητο" "Angel" "Άγγελος" "Atmosphere" "Ατμόσφαιρα" "Catastrophe" "Καταστροφή" "Chaos" "Χάος" "Climate" "Κλίμα" "Cosmos" "Κόσμος" "Democracy" "Δημοκρατία" "Ecstasy" "Έκσταση" "Economy" "Οικονομία" "Genesis" "Γένεση" "Horizon" "Ορίζοντας" "Myth" "Μύθος" "Planet" "Πλανήτης" "Rhythm" "Ρυθμός" "Sphere" "Σφαίρα" "Telephone" "Τηλέφωνο" ,,,, * umlaut or diaresis words in English ------- "cooperate" "coöperate" "naivete" "naïveté" "reelect" "reëlect" "aerie" "aërie" "Noel" "Noël" "Chloe" "Chloë" "Zoe" "Zoë" "Moeller" "Moëller" "Curacao" "Curaçao" Umlaut (in borrowed German words): "uber" "über" "doppelganger" "doppelgänger" "fuhrer" "Führer" "gemutlichkeit" "Gemütlichkeit" "schadenfreude" "Schadenfreude" ,,,, * ligature words for text.tohtml.pss ------ fi (f + i) ff (f + f): unusual spellings "fairy" "faerie" "fairy" "færie" "eon" "æon" "aetiology" "ætiology" "encyclopaedia" "encyclopædia" "archaeology" "archæology" "mediaeval" "mediæval" "primaeval" "primæval" "caesura" "cæsura" "Caesarean" "Cæsarean" "anaemia" "anæmia" # just the base of the word "anaemi" "anæmi" "faec" "fæc" "faec" "fæc" "diaeresis" "diæresis" "diaresis" "diæresis" "dieresis" "diæresis" "leucaemia" "leucæmia" "paediatrics" "pædiatrics" "orthopaedic" "orthopædic" œ Ligature Words: "foetus" "fœtus" "foetid" "fœtid" "fetid" "fœtid" "gynaecology" "gynæcology" "homoeopathy" "homœopathy" "oesophagus" "œsophagus" # just the root of the word "oesophag" "œsophag" "Oedipus" "Œdipus" "diarrhoea" "diarrhœa" "oeconomics" "œconomics" "manoeuvre" "manœuvre" "phoenix" "phœnix" "amoeba" "amœba" ,,,, ideas: - style the title attribute *tool-tips* for etymologies and cognate words. Greek, Latin, Arabic, Indonesian, spanish, portuguese. - these etymologies could be got from an external text file with the nom://system command (1 aug 2025: not implemented). - what ligatures can be used in English words, and what unusual spellings. - make a "drop-cap" function for /eg/text.tohtml.pss so that the pattern

at the start of a line will be converted to a drop capital (within the paragraph text). - an example script showing footnotes and table of contents, and showing how to include one or more [TOC] and [FOOT] markers in the source text. - make pep -I output the machine state with program to a text file in the same way as now, but with no colours. This can be used as input for the generated booklet about pep/nom - write /eg/machine.tohtml.pss which converts a plain text representation of the pep,nom machine (with a part program list) into html, or postscript or latex etc or EPUB. * pep parsing with the xml.parse.pss script ----- Partial Program Listing (size:1390 ip:106 cap:20000) 103: testclass [class:alnum] 104: jumpfalse [int:7] 105: while [class:alnum] 106> put 107: clear 108: add [text:name*] --------- Machine State ----------- (Buff:16/39 +r:0) Stack[starttag*] Acc:0 Flag:TRUE Esc:\ Delim:* Chars:12 Lines:1 --------- Tape -------------------- Tape Size: 500 4/10 ) 0 [book] 4/10 ) 1 [book] 0/10 ) 2> [] 0/10 ) 3 [] ,,,, **Ideas for a [TOC] and [FOOT] script** : This script would be a development of /eg/toc.tohtml.pss which creates an html table of contents from a plain text document. The script would be called /eg/tocfoot.tohtml.pss and would allow the inclusion of one or more [TOC] and [FOOT] markers in the source text. These markers would be converted to a table of contents and a list of footnotes respectively. * Here is a sketch of the script -------+ # name and reserve 2 cells at the top of the tape for # the table of contents and footnote list. begin { mark "toc"; ++; mark "foot"; ++; } whilenot [:space:]; !"" { put; lower; "[toc]" { clear; add "toc*"; push; .reparse } "[foot]" { clear; add "foot*"; push; .reparse } clear; add "word*"; push; .reparse } # .... here actually build the toc with headings and the # .... foot with footnotes. while [:space:]; clear; parse> pop; pop; "word*word*","text*word*" { clear; get; add " "; ++; get; --; put; clear; add "text*"; push; reparse } # this code should allow multiple table-of-contents in one # document. (eof) { "text*toc*" { clear; get; mark "here"; go "toc"; get; go "here"; put; clear; add "text*"; push; .reparse } "toc*text*" { clear; ++; get; --; mark "here"; go "toc"; get; go "here"; put; clear; add "text*"; push; .reparse } "text*foot*" { clear; get; mark "here"; go "foot"; get; go "here"; put; clear; add "text*"; push; .reparse } "foot*text*" { clear; ++; get; --; mark "here"; go "foot"; get; go "here"; put; clear; add "text*"; push; .reparse } "foot*toc*" { clear; mark "here"; go "foot"; get; go "toc"; get; go "here"; put; clear; add "text*"; push; .reparse } "toc*foot*" { clear; mark "here"; go "toc"; get; go "foot"; get; go "here"; put; clear; add "text*"; push; .reparse } } push; push; ,,,, ### 1 August 2025 Working on /eg/timeline.tohtml.pss which seems to work without any huge amount of testing. It can also test itself with: * test the timeline script >> pep -f timeline.tohtml.pss -i /test | bash But this script doesnt have any self-translation facilities (unlike the xml.parse.pss script). I wrote a separate script that translates scripts to different languages (based on the code in /eg/xml.parse.pss ) and then calls that from within the script help-words This is called /eg/script.translation.pss ### 31 July 2025 script ideas - the machine.todiagram script for displaying the machine state with a program - timeline for formatting a timeline: /eg/timeline.tohtml.pss - index.parser for showing how to parse a table of contents or index This is called /eg/toc.pss and seems to work. Also, I wrote /eg/toc.tohtml.pss which converts a list of headings into a html table of contents with links. This is somewhat useful and it contradicts what I have assumed for a few years: That if I use the 1st few cells of the tape as a kind of buffer array for saving values, then the normal script operation will interfere with, or overwrite those cells. But this, I think, *isn't true* because basically, the nom:pop and nom:push commands are designed to do nothing on an empty pep:stack and an empty pep:workspace buffer respectively. This is important in the context of writing a *type-checking* parser, where the parser is trying to verify that a variable is being assigned the correct type of variable for example >> x = "hello"; Now if 'x' has been defined as an integer, our language may wish to complain bitterly about trying to sausage-in a piece of text (string) into our 32/64 (whatever) bit piece of memory. The key to this, when using pep/nom as a parser, is maybe to save the type of each variable in the top tape cells. However there are some significant additional problems: *scope* (which maybe doable with some kind of dot notation) and also the fact we have no idea how many variables need to be checked (unless we do 2 passes) and therefore don't know how many tape-cells to allocate for this purpose. ### 28 July 2025 The /to word seems to work for rust/dart/go/java and compiles, and the translated script can be tested with /testone. Also with lua/ruby. I have been working on the /testone help word in the /eg/xml.parse.pss (limited) xml recogniser. This word, combined with the /to help word (which translates the script to another language) tests the script, or a translation of the script with some sample xml input. The system seems very useful and transferable to other scripts. It is probably even worth-while extracting it to a separate nom script which I will call something like /eg/discuss.nom.pss The discuss.nom.pss script is supposed to be a "Tiny Language Model" (a TLM) which can receive phrases like - 'translate the file xml.parse.pss into ruby' - 'translate that to python' - 'test the translation' - 'test it' (Actually the script /eg/nom.to.pss can do this but not with the 'it' words, at least not yet) So, the TLM, powered by pep/nom will accept simple English sentences and parse them into actions or queries. Words like 'it' 'that' 'this' require some *state* to be saved and this will be done by nom using the nom://system command (or maybe read!) which will execute a system command and read the result of the command into the workspace. ### 27 July 2025 Fixed a couple of bugs in /eg/xml.parse.pss I seem to have fixed the ".reparse with begin block" bug. But only for the lua and rust translators. Now I have to fix it for the other translators. My help system in the scripts often uses a .reparse within a begin block to trigger the help system when an empty document is found, or an invalid first character. ### 26 July 2025 Discovered that the nom://reparse command does not work within the begin blocks for some translators. This is because .reparse either uses a "goto" or a break; or continue; command. The break; command won't work because the begin {} block is completely separate to the lex and parse blocks. ### 25 July 2025 Found bugs in /tr/nom.tolua.pss and /tr/nom.torust.pss when translating /eg/xml.parse.pss and /eg/text.tohtml.pss This was caused by the nom://restart and nom://reparse commands in a nomsyn://begin block Scripts could also test themselves. ### 24 July 2025 Done: - /eg/nom.to.pss a nom script that accepts instructions like "translate file.pss to ruby" and will carry out the instruction or else just print out the necessary commands. - /eg/timeline.tohtml.pss the same but for an historical timeline.(done) - not much. Some ideas: - read! or nom://system command which is a new command that reads a shell process into the workspace. (not implemented) - a 'BB' and 'EE' test: test if the workspace ends with or start with the current pep://tape cell. - self translation: in the help system in any script (implemented by the help* token) it is possible to put a /to help word that will translate the current script into another language. (DONE) - faq.pss translate a simple FAQ text format into html - text.toman.pss create a man page for a document - /toprint helpword to create a printable version of the script. I made some progress adding self translation to the /eg/text.tohtml.pss This seems very promising and could be added to any significant script. I seem to have abandoned the ideas and todo files of this documentation and will probably just put everything here. ### 23 July 2025 Added the beginnings of a help system to /eg/text.tohtml.pss Had the idea of a TLM a "Tiny Language Model", which is just a nom script which parses simple commands and then possibly executes it. Also, a "random" command, which selects a random section of text between 2 delimiters. ### 22 July 2025 I like the idea of implementing help/error tokens in even simple scripts. These help systems can also be triggered by keywords at the start of the 'document', possibly wrapped in comment syntax for the output language. I will try to add such a help system to /eg/text.tohtml.pss ### 21 July 2025 Added some ideas to the /eg/natural.language.pss script and also add an example phrase grammar to the comment section. I had the idea that a simple natural language parser could be used to generate frequently used bash commands such as "reducing the size of an image", "making an image black and white", and so forth. But this would probably have to be combined with some repl loop written in dart/rust/ruby or anything else to actually execute the commands. So the nom script would parse the input and generate the bash command or commands, and then the script written in ruby would actually execute the commands. The ruby script could also handle reference words like "that" or "this" which would refer to filenames that have previously been mentioned. This requires remembering state in a way that would be difficult, if not impossible in pep/nom. * some example commands ------ choose an image to edit choose image show it's dimensions show dimensions shrink it by half. Shrink by 50% make this black and white. ,,,, This idea came from a simpler one: given a command like "translate to ruby" a nom script will generate the bash commands necessary to translate a nom script into the ruby language. From there is seems an easy step to actually execute the commands... ### 20 July 2025 revised the /eg/flyer.typewriter.tohtml.pss script to include an error* and help* token. Thought about presenting the idea of pep/nom at some language conference. O'reilly's "Emerging Languages" Conference would have been ideal (even though nom is not emerging anywhere) but that conference is no longer. ### 18 July 2025 I wrote a simple letter-to-html formatting script called /eg/letter.typewriter.tohtml.pss which may be interesting because it includes its own help system with documentation. This seems a nice way for the script to be "self-documenting". ### 13 July 2025 I haven't been doing any work on the pep:nom system except to write a somewhat dodgy script at /eg/script.tag.pss which is supposed to remove html