A programming language that speaks cat.
PurrScript is a transpiler that translates cat commands into Python. No more boring print(), only meow(). No more True, only treat.
- Python 3.6+
git clone https://github.com/FelineFantasy/PurrScript
cd PurrScript
python purrscript.py installAfter installation, run .purr files from anywhere:
purr hello.purrCreate a file named
hello.purr:MR treat meow("Привет, я кот!") PRRun the script:
purr hello.purr
Expected output:
Привет, я кот!
| PurrScript | Python | Description |
|---|---|---|
MR | # program started | Entry point |
PR | # program finished | Exit point |
treat | treat = True | Default variable |
meow(...) | print(...) | Output |
beg(...) | input(...) | Input |
sniff | if | Conditional |
peer | elif | Conditional |
other_paw | else | Conditional |
and_paw | and | Logical AND |
or_paw | or | Logical OR |
not_paw | not | Logical NOT |
nap | def | Function definition |
box | class | Class definition |
bring | return | Return statement |
hunt | while | Loop |
zoom | for | Loop |
hiss | break | Break loop |
gimme | import | Import module |
out_of | from | Import from |
with_blanket | with | Context manager |
as_paw | as | Alias |
yowl | raise | Raise exception |
purr(...) | str(...) | String cast |
bite(...) | int(...) | Integer cast |
lick(...) | float(...) | Float cast |
mood(...) | bool(...) | Boolean cast |
tail(...) | list(...) | List creation |
basket(...) | tuple(...) | Tuple creation |
clowder(...) | set(...) | Set creation |
scent(...) | dict(...) | Dictionary creation |
void_box | None | None type |
claw(...) | open(...) | Open file |
scratch(...) | write(...) | Write to file |
sniff_file(...) | read(...) | Read file |
close_door(...) | close(...) | Close file |
hiss_error | try | Try block |
catch_mouse | except | Except block |
finally_nap | finally | Finally block |
YES | True | Boolean True |
NO | False | Boolean False |
- 🚨
EntryThresholdNotFound— missingMRat the beginning of the file. - 🚨
ExitDoorAjar— missingPRat the end of the file. - 🚨
NoSnacksError— missing requiredtreatdeclaration.
If you enjoy PurrScript and want to help keep the project alive, you can support me here:
Your support helps me:
- 🐱 Add new cat commands
- 🛠️ Fix bugs and improve the transpiler
- ☕ Stay awake while coding at 4 AM
Every little bit is appreciated! ❤️
- FelineFantasy
- License: MIT