Just for funBangLang
Python, but Make It Bangalore
A joke programming language that swaps Python keywords for Bangalore slang and runs .blr files from the command line.
- 9 slang keywords mapped to Python
- Installs a blr command via setuptools
- Regex transpiler with word boundaries, longest match first
- Sample program grades a list of marks
Rochester, N.Y. The README says I built this because I was bored, and that's true. BangLang maps nine Bangalore slang words onto Python keywords. put_scene defines a function, tell_da prints, yaavuh, or_what and otherwise are if, elif and else, one_by_one is a for loop and cut_ra breaks out of it. Install it with pip and you get a blr command that runs .blr files, with error messages that stay in character.
Under the hood it's upfront about being a joke: regex replacements with word boundaries, longest keyword first, then exec() in a fresh namespace. There's no real lexer, so a keyword inside a string gets translated too. Doing it properly would mean writing a real tokenizer.