Pep & Nom

home | documentation | examples | translators | download | journal | blog | all blog posts

Fortune is like a woman: if you reject her today, do not expect to meet with her tomorrow. Napoleon

nom example scripts

This folder contains some example scripts in the NOM script language. Scripts have the file extension “.pss”. These examples can be run using the interpreter and debugger (the “pep” interpreter) or by translating to rust| dart| perl| lua| go | java | javascript| ruby | python| tcl | c and then (maybe compiling and) running.

The Pep & Nom system is currently in upheaval (may 2026) because of the arrival of syntagma* which is implemented (partially) in /tr/syntagma.pss . The shell scripts /tr/engine.lua.sh and /tr/engine.perl.sh allow the “interpretation” of syntagma scripts.

Documentation for the NOM language and PEP virtual machine is in the /doc/ folder.

The scripts which begin with ro. are solutions (or attempted solutions) to problems on the www.rosettacode.org site. For example the script ro.balanced.brackets.pss solves the balanced_brackets problem .

examples can be run with the interpreter by typing

  pep -f eg/script.pss <inputfile>
  # or
  pep -f eg/script.pss -i <inputtext>
 

Examples can be translated into rust| dart| perl| lua| go | java | javascript| ruby | python| tcl | c by running the appropriate translation script.

translate a nom script into go, compile and run

   pep -f tr/translate.go.pss eg/script.pss > script.go
   go build script.go
   echo "<input>" | ./script
 

Also the script /eg/nom.to.pss will translate a script with a simple prompt.

translate a script to 'rust' with nom.to.pss and compile (with rustc)
 pep -f nom.to.pss -i 'translate script.pss to rust'

Some scripts also have self-translation (for example /eg/json.check.pss and /eg/maths.tolatex.pss and /eg/text.tohtml.pss)

some example scripts

I will probably rewrite many of these example scripts in the syntagma language, since it is much easier to read than nom.

naming

ideas for example scripts

I will probably try to do most implementation in the syntagma language in the future.

other things