ℙ𝕖𝕡 🙴 ℕ𝕠𝕞

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

En casa del herrero, cuchillo de palo. (In the blacksmith's house, the spoon is wooden) Spanish saying

the translation folder for the ℙ𝕖𝕡/ℕ𝕠𝕞 system

This folder contains a number of nom translation scripts which are also capable of translating themselves and other translation scripts as well.

The scripts which are currently working and reasonably debugged are rust | dart | lua | go | java | javascript | ruby | python | tcl | c

translation examples

Here are some examples of how to translate a script into a target language listed above.

translate an inline script to lua and print to stdout
 pep -f nom.tolua.pss -i "r;[\n]{lines;add ' ';}print;d;"

translate an inline script to lua and run with input

    pep -f nom.tolua.pss -i "r;[\n]{lines;add ' ';}print;d;" > test.lua
    echo -e "leaf \nbranch\n twig" | lua test.lua
    # This will print each line numbered, or run with a file at input
    # (but won't number the first line!)
    cat /usr/share/dict/words | lua test.lua
  

translate a ℕ𝕠𝕞 script file to lua and run with input

    pep -f tr/nom.tolua.pss eg/nom.syntax.reference.pss > syntax.lua
    echo  "read;add '/';print;clear;" | lua syntax.lua
    # or run with a file at input
    cat eg/palindrome.pss | lua syntax.lua
    # or use the command line switches for input
    # (but this is more for testing purposes)
    lua syntax.lua --file eg/palindrome.pss 
    # or 
    lua syntax.lua --input "read;add '/';print;clear;" 
  

You can also use the bash functions in bumble.sf.net/books/pars/helpers.pars.sh to translate into a particular language.

translate inline script into ruby and run with input
 pep.rbs 'read;add".";print;clear;' 'abcd'