Skip to main content

H++ - Hinglish Plus Plus, ek nai programming language

Project description

H++ (Hinglish Plus Plus) 🚀

Socho Hindi mein, code karo duniya mein!

H++ ek interpreter-based programming language hai jisme Hinglish aur English keywords dono milte hain. Indian developers ke liye banai gayi, jisse aap apni bhasha mein soch kar code likh sakein.

What is H++?

H++ ek friendly language hai jo:

  • Hindi-style syntax provide karti hai
  • .hpp files seedha run karti hai
  • string interpolation ${...} support karti hai
  • classes, functions, loops, aur error handling offer karti hai
  • built-in modules Ganit, Faail, Samay, Jaal deti hai

Installation

pip install hplusplus
hpp --version

Local development:

pip install -e .
hpp examples/hello.hpp

Quick Start

examples/hello.hpp:

shuru karo {
    bol("Namaste duniya!")
}

Run:

hpp examples/hello.hpp

Syntax Guide

Variables

rakho naam = "Aashu"
pakka PI = 3.14
  • rakho: variable
  • pakka: constant

Print

bol("Namaste!")
bol("Naam: ${naam}")

If / Else

agar (umar >= 18) {
    bol("Adult")
} warna {
    bol("Minor")
}

Loops

chakkar (rakho i = 1; i <= 5; i++) {
    bol(i)
}

jabtak (n < 3) {
    bol(n)
    n = n + 1
}

Functions

kaam jodo(a, b) {
    wapas a + b
}

bol(jodo(2, 3))

Classes

parivaar Student {
    banao(naam) {
        yeh.naam = naam
    }

    hello() {
        wapas "Namaste " + yeh.naam
    }
}

rakho s = naya Student("Aashu")
bol(s.hello())

Error Handling

koshish karo {
    phenko "Kuch galat hua"
} pakdo (e) {
    bol("Pakda: ${e}")
}

String Interpolation

rakho naam = "Aashu"
rakho umar = 21
bol("Mera naam ${naam} hai aur umar ${umar} saal")

List Methods

rakho nums = [3, 1, 4]
nums.jodo(9)
bol(nums.lambai)
nums.sajaao()
bol(nums.milaao(", "))

Common list methods: jodo, hatao, chhano, badlo, dhundho, milaao, sajaao, ulta_karo, hai_andar, lambai.

String Methods

rakho msg = "  Namaste H++  "
bol(msg.saaf_karo())
bol(msg.BADA_KARO())
bol(msg.chhota_karo())

Common string methods: lambai, BADA_KARO, chhota_karo, saaf_karo, kaat_do, hai_andar, kahan_hai, badal_do, shuru_hota_hai, khatam_hota_hai.

Modules

Modules are available globally without import.

bol(Ganit.sqrt(16))
bol(Ganit.PI)

Faail.likho("demo.txt", "Namaste")
bol(Faail.padho("demo.txt"))

rakho abhi = Samay.abhi()
bol(abhi.sundar())

bol(Jaal.JSON.parse("{\"a\": 1}").a)

Available modules:

  • Ganit: math utilities
  • Faail: file utilities
  • Samay: date/time utilities
  • Jaal: HTTP and JSON utilities

Examples

1. FizzBuzz

shuru karo {
    chakkar (rakho i = 1; i <= 30; i++) {
        agar (i / 15 == Ganit.podha(i / 15)) {
            bol("FizzBuzz")
        } warna agar (i / 3 == Ganit.podha(i / 3)) {
            bol("Fizz")
        } warna agar (i / 5 == Ganit.podha(i / 5)) {
            bol("Buzz")
        } warna {
            bol(i)
        }
    }
}

2. File Read / Write

shuru karo {
    Faail.likho("note.txt", "Namaste H++")
    Faail.jodo("note.txt", "\nDusri line")

    rakho content = Faail.padho("note.txt")
    bol(content)

    Faail.mitao("note.txt")
}

3. Class Example

parivaar BankAccount {
    banao(owner, balance) {
        yeh.owner = owner
        yeh.balance = balance
    }

    jama(amount) {
        yeh.balance = yeh.balance + amount
        wapas yeh.balance
    }
}

shuru karo {
    rakho acc = naya BankAccount("Aashu", 1000)
    bol("Balance: ${acc.jama(500)}")
}

VS Code Extension

Local install:

cd vscode-hpp
npm install -g @vscode/vsce
vsce package
code --install-extension hplusplus-1.0.0.vsix

Contributing

  1. Fork the repository.
  2. Create a branch.
  3. Add examples, fixes, or docs.
  4. Open a pull request.

License

MIT License

After installing, .hpp files get syntax highlighting, snippets, bracket behavior, and comment toggling.

Contributing

Contributions welcome hain. Aap:

  • Bugs report kar sakte ho
  • Examples add kar sakte ho
  • Parser/interpreter features improve kar sakte ho
  • VS Code extension polish kar sakte ho

Development loop:

pip install -e .
python main.py examples/hello.hpp
python main.py examples/classes.hpp
python main.py examples/ganit_test.hpp

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hinglish_plus_plus-1.0.0.tar.gz (21.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hinglish_plus_plus-1.0.0-py3-none-any.whl (24.5 kB view details)

Uploaded Python 3

File details

Details for the file hinglish_plus_plus-1.0.0.tar.gz.

File metadata

  • Download URL: hinglish_plus_plus-1.0.0.tar.gz
  • Upload date:
  • Size: 21.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for hinglish_plus_plus-1.0.0.tar.gz
Algorithm Hash digest
SHA256 e121c1eabd08824d18d4246ca7ee6fd4607a2bfda86637874e293b14d565f497
MD5 6c7dce4570442f6814dc31026b66747c
BLAKE2b-256 da314fa06ba1f9dcf8b195c13d409e76f3889232fb95708e51b2be8dcff19653

See more details on using hashes here.

File details

Details for the file hinglish_plus_plus-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for hinglish_plus_plus-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7b48971d542e77b2986b99d3828a16e837692acf48b3567d9a85f2f39fec8b04
MD5 8b2f3293f4994c9ef2caab09a7086f73
BLAKE2b-256 51812d86dd5c013abe5e79b5a3d8c8bf7849105da04c8f46b089c0c2d75200bd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page