Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyBosnian 🇧🇦

A fun programming language that translates Bosnian keywords to Python! Write Python code using your native Bosnian language.

About

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.

Features

Currently supports 28 Bosnian keywords translated to Python:

Control Flow

  • akoif
  • inaceelse
  • inaceakoelif
  • ponovifor
  • dokwhile
  • prekinibreak
  • nastavicontinue

Functions & Classes

  • funkcijadef
  • vratireturn
  • klasaclass

Boolean & Logic

  • TacnoTrue
  • NetacnoFalse
  • iand
  • ilior
  • nenot

Built-in Functions

  • ispisiprint
  • duzinalen
  • unosinput
  • rasponurange

Imports

  • uveziimport
  • izfrom
  • kaoas

Exception Handling

  • pokusajtry
  • osimexcept
  • konacnofinally

Other

  • uin
  • sawith
  • prosleditipass

Installation

Prerequisites

  • Python 3.6 or higher
  • VS Code (optional, for syntax highlighting)

Setup

  1. Clone the repository:
git clone https://github.com/najtms/PyBosnian.git
cd PyBosnian
  1. That's it! No additional dependencies required.

VS Code Setup (Optional)

For the best experience with syntax highlighting:

  1. Install the TODO Highlight extension
  2. Open the project folder in VS Code
  3. The workspace settings are already configured for keyword highlighting

Usage

Running .bos files

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.bos

In VS Code

Simply press the Run button (▶) in the top-right corner!

Examples

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

Quick Example

# 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")

How It Works

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().

Contributing

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!

License

This project is open source and available for anyone who wants to learn or have fun with it.

Author

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! 🚀

About

PyBosnian is a playful Python variant that replaces Python keywords with Bosnian words. Explore coding in a new way, have fun with your programs, and see Python through a Bosnian twist!

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages