A fun programming language that translates Bosnian keywords to Python! Write Python code using your native Bosnian language.
This is a personal project created purely out of enjoyment towards Python and having fun with programming languages. The goal is to show how the Bosnian language would look as a programming language and to help Bosnian speakers learn programming concepts in their native language.
Currently supports 28 Bosnian keywords translated to Python:
ako→ifinace→elseinaceako→elifponovi→fordok→whileprekini→breaknastavi→continue
funkcija→defvrati→returnklasa→class
Tacno→TrueNetacno→Falsei→andili→orne→not
ispisi→printduzina→lenunos→inputrasponu→range
uvezi→importiz→fromkao→as
pokusaj→tryosim→exceptkonacno→finally
u→insa→withproslediti→pass
- Python 3.6 or higher
- VS Code (optional, for syntax highlighting)
- Clone the repository:
git clone https://github.com/najtms/PyBosnian.git
cd PyBosnian- That's it! No additional dependencies required.
For the best experience with syntax highlighting:
- Install the TODO Highlight extension
- Open the project folder in VS Code
- The workspace settings are already configured for keyword highlighting
Create a file with the .bos extension and write your code in Bosnian:
# hello.bos
ispisi("Zdravo, svijete!")
ponovi broj u rasponu(5):
ispisi(broj)
Run it using:
python3 bos.py your_file.bosSimply press the Run button (▶) in the top-right corner!
Check out the examples/ folder for demonstrations:
- Example_1_petlje.bos - Loops (for, while, break, continue)
- Example_2_funkcije.bos - Functions and return statements
- Example_3_uslovi.bos - Conditionals and logical operators
- Example_4_liste.bos - Lists and iteration
- Example_5_klase.bos - Classes and objects
- Example_6_greske.bos - Exception handling
# Function that checks if a number is even
funkcija je_paran(broj):
ako broj % 2 == 0:
vrati Tacno
inace:
vrati Netacno
# Test it
ponovi broj u rasponu(10):
ako je_paran(broj):
ispisi(broj, "je paran")
inace:
ispisi(broj, "je neparan")
The interpreter (bos.py) reads your .bos file, translates Bosnian keywords to Python using regex with word boundaries, and executes the translated code using Python's exec().
This is a personal fun project, but if you have ideas for more keywords or improvements, feel free to open an issue or pull request!
This project is open source and available for anyone who wants to learn or have fun with it.
Created by @najtms - Made with ❤️ for the Bosnian community and Python enthusiasts!
Napomena: Ovo je eksperimentalni projekat napravljen iz zabave. Uživajte u kodiranju na bosanskom! 🚀