~fabrixxm/prain

Unusefull python3 to brainfuck compiler
Add license
Char as optimized str w len 1, add `ord()`,`chr()`, fix typos
Update README

refs

master
browse  log 

clone

read-only
https://git.sr.ht/~fabrixxm/prain
read/write
git@git.sr.ht:~fabrixxm/prain

You can also use your local clone with git send-email.

#Prain

unusefull python3 to brainfuck compiler

run as

pyrain.py [-d] <input file|-> [output file]

-d : print debug data to stdout
input file: python2 script. if "-", read from stdin
output file: write result to stdout if not specified

what works:

  • data types: int1, string, char2
  • variable assignment from constant
  • variables copy
  • int + int, int - int, char + char
  • print(), int(), len(), ord(), chr()
  • input([prompt])
  • function definition with default arguments
  • function call with positional parameters3
  • local vars in functions
  • global keyword

  1. 8-bit unsigned integer only
  2. created from static single-char string, eg k = "c"
  3. print() function accept end=str parameter