
Baypy
Python, written in Baybayin, with a playground that runs in your browser.
What it is
Baypy lets you write Python in Baybayin, the old Filipino script. if becomes ᜃᜓᜅ᜔ (kung), def becomes ᜆᜓᜃᜓᜌᜒᜈ᜔ (tukuyin), and print becomes ᜁᜉᜃᜒᜆ (ipakita). You can run a file from the terminal, or open the playground and write code in your browser with nothing to install.
You don't need a Baybayin keyboard either. Type in Tagalog with normal letters, and Baypy converts it for you.
Why I built it
Mostly for fun. I saw people making programming languages in Chinese, like zhpy, and then found Bato, which is Ruby written in Tagalog. I wanted to make something like that, and Baybayin felt like a nice fit.
How it works
I didn't have to write a new language. Python 3 already accepts Baybayin letters in names, so only the keywords and built-ins need translating. Baypy reads your code with Python's own tokenizer, swaps those words for their Python versions, and lets Python run the result. Your own variable and function names stay in Baybayin.
The playground runs real Python in the browser with Pyodide. It runs in a web worker, so the Stop button can end a program that would otherwise never finish.
Tricky parts
Python splitting my words. Before Python 3.12, the tokenizer cuts Baybayin names apart at the vowel marks, so I had to glue the pieces back together. Those versions also treat an f-string as a single piece of text, so the code inside its braces needs translating separately.
Knowing what not to convert. Typing in normal letters means converting almost everything, but not quite. Module names like math.sqrt have to stay in Latin, and so do escape codes and format codes inside strings.
The script itself. Baybayin has no capital letters, and e and i share a letter, as do o and u. So Hayop and hayop are the same name. And because ᜐ means in and ᜂ means or, neither can be a variable name.
