What is the point of a blog? Why do people write blogs? What is Pep? and what is Nom? This blog which is currently at peptool.org and hopefully soon will be at pepnom.org is an attempt to discuss the Pep (Parsing Engine for Patterns) virtual machine, and the Nom scripting language. This is a system which I have implemented and experimented with for recognising, parsing and transpiling context free languages.
I have been working on this system, off and on, for a long time. Decades in fact. It has all sorts of interesting possibilities but is, as far as I know, known and used by nobody but me. It is a strange feeling to be the only speaker of a language, hopefully a language which is not dying but being born. The purpose of this blog is to bring this small but sparkly gem into the light of the day and hopefully share my wonder at its strange possibilities.
Pep and Nom are, to some extent, experimental even though the implementation seems quite robust. It is experimental in the sense that I am still exploring it’s usefulness for everyday programming tasks and I know that its syntax will seem initially cryptic to the new user. But its syntax reflects the underlying Pep machine and it tries to follow standard Unix tool conventions: it uses { and } to delimit blocks, ; to terminate statements and it is designed as a text stream editor.
There are Nom scripts to parse and check the syntax of json files , translate arithmetic expressions into Lisp syntax , format html from a minimal markup plain text format , (which is used by this blog to render the html pages), compile gnu sed scripts into java (the gnu sed branching commands are missing because java lacks a “goto” statement), compile the brainf**k language into the c language , parse Nicholas Wirth's PL/0 teaching language
The source code for pep & nom is hosted on Sourceforge and includes some examples of what can be done with it. The code also includes numerous translation scripts which can be used to translated Nom scripts into other languages, such as Go, Java, Python, Javascript, Tcl, Perl etc.
I invite you to explore Pep/Nom which I think will be rewarding for anybody interested in language, text patterns, compiling or virtual machines.
mjb