Skip to main content

शिल्प — हिन्दी में लिखी जाने वाली, पायथन पर आधारित प्रोग्रामिंग भाषा (A Hindi programming language with Python semantics)

Project description

शिल्प (Shilp) - Sahaj Hindi Lipi Prakalp...

हिन्दी में लिखी जाने वाली, पायथन पर आधारित प्रोग्रामिंग भाषा। A Hindi programming language whose semantics are identical to Python — keywords, builtins, variables, and error messages, all in Hindi (Devanagari).

कार्य अभिवादन(नाम):
    अगर नाम == "":
        वापस "नमस्ते, दुनिया!"
    वापस f"नमस्ते, {नाम}!"

हर व्यक्ति में ["अर्जुन", "प्रिया", "कबीर"]:
    छापो(अभिवादन(व्यक्ति))
$ shilp namaste.shilp
नमस्ते, अर्जुन!
नमस्ते, प्रिया!
नमस्ते, कबीर!

त्रुटियाँ भी हिन्दी में / Errors are in Hindi too:

अनुरेखण (सबसे हालिया कॉल अंतिम):
  फ़ाइल "khel.shilp", पंक्ति 8, <मुख्य स्तर> में
    छापो(भाग(१०, ०))
  फ़ाइल "khel.shilp", पंक्ति 5, कार्य 'भाग' में
    वापस अ / ब
शून्य से भाग त्रुटि (ZeroDivisionError): शून्य से भाग संभव नहीं

स्थापना / Install

pip install shilp          # from a local wheel: pip install dist/shilp-*.whl

Requires Python ≥ 3.12. A standalone Linux binary (no Python needed) is in dist/bin/.

प्रयोग / Usage

आदेश काम
shilp अन्तरक्रियात्मक सत्र (REPL)
shilp खेल.shilp [तर्क...] कार्यक्रम चलाएँ
shilp chalao खेल.shilp कार्यक्रम चलाएँ (run)
shilp anuvad खेल.shilp [-o out.py] उत्पन्न पायथन कोड देखें — "मुझे पायथन दिखाओ"
shilp anuvad --ulta खेल.py [-o out.shilp] पायथन कोड को शिल्प में बदलें — "मुझे शिल्प दिखाओ"
shilp jaanch खेल.shilp केवल वाक्यविन्यास जाँचें
shilp --madad सहायता

यह कैसे काम करता है / How it works

Shilp is a thin, token-level translation layer over CPython (see PLAN.md):

  1. Devanagari numerals (१२.५) are converted to ASCII outside string literals.
  2. The source is tokenized by Python's own tokenizer; Hindi keywords arrive as NAME tokens and are remapped (अगरif) with line numbers preserved exactly.
  3. CPython compiles and runs the result — so every Python feature works: classes, generators, decorators, असिंक/प्रतीक्षा (async/await), मिलान/मामला (match/case), f-strings…
  4. Hindi builtins (छापो, लंबाई, श्रेणी, …) are injected as aliases of the real builtins; a custom excepthook renders tracebacks in Hindi with the original Hindi source lines.

Because the mapping is one-to-one and reversible, Shilp is tested differentially against CPython: reference Python programs are machine-converted to Shilp, both are executed, and outputs must match.

  • Python modules and pip packages import as-is: आयात math, से random आयात randint.
  • Multi-file programs work: आयात मेरा_मॉड्यूल finds मेरा_मॉड्यूल.shilp.
  • Methods/attributes (.append, .split) remain English in v1 — see SPEC.md.
  • Word tables are data (shilp/shabdkosh/) — future language packs (मराठी, தமிழ், বাংলা…) need no engine changes.

भाषा एक नज़र में / Language at a glance

पायथन शिल्प पायथन शिल्प
if / elif / else अगर / अन्यथा_अगर / अन्यथा def / return कार्य / वापस
for / in / while हर / में / जब_तक class वर्ग
try / except / finally कोशिश / पकड़ो / अंत_में import / from / as आयात / से / जैसा
True / False / None सत्य / असत्य / रिक्त and / or / not और / या / नहीं
break / continue / pass तोड़ो / जारी / छोड़ो raise / assert / del उठाओ / दावा / हटाओ

Full tables: SPEC.md. Examples: examples/.

विकास / Development

python3 -m unittest discover -s tests    # परीक्षण चलाएँ
python3 -m shilp examples/namaste.shilp  # बिना install किए चलाएँ

VS Code syntax highlighting + phonetic snippets (agarअगर): editors/vscode/. Pygments: pygmentize -l shilp works once shilp and pygments are installed.

License

GPL Ver 3.0

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

shilp-0.1.0.tar.gz (39.9 kB view details)

Uploaded Source

Built Distribution

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

shilp-0.1.0-py3-none-any.whl (37.6 kB view details)

Uploaded Python 3

File details

Details for the file shilp-0.1.0.tar.gz.

File metadata

  • Download URL: shilp-0.1.0.tar.gz
  • Upload date:
  • Size: 39.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for shilp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 63dba61264ae4e45282d174a1ec5c32f49de515922c1e270bdef9972fe955082
MD5 d0ecaf76a7d3e3f304876309df8040f0
BLAKE2b-256 b4a3c358ed1a2d1d08e72e18faa0acac52427147711d1f95a8aa15908c1404da

See more details on using hashes here.

File details

Details for the file shilp-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: shilp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 37.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for shilp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4730f0e4577e4647073721e26c149beaf9e1f30dd6525826403d483931009583
MD5 df71d79c74273d7b8f2f03b7e5272645
BLAKE2b-256 72f24e316a6836f36a8ec96b4b1d9ed095eb89067304bd79a7620e9d417af90c

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