हिन्दी में लिखी जाने वाली, पायथन पर आधारित प्रोग्रामिंग भाषा। 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): शून्य से भाग संभव नहीं
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/.
| आदेश | काम |
|---|---|
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 |
सहायता |
Shilp is a thin, token-level translation layer over CPython (see PLAN.md):
- Devanagari numerals (
१२.५) are converted to ASCII outside string literals. - The source is tokenized by Python's own tokenizer; Hindi keywords arrive as
NAMEtokens and are remapped (अगर→if) with line numbers preserved exactly. - CPython compiles and runs the result — so every Python feature works:
classes, generators, decorators,
असिंक/प्रतीक्षा(async/await), मिलान/मामला (match/case), f-strings… - 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.
| पायथन | शिल्प | पायथन | शिल्प |
|---|---|---|---|
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/.
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.
GPL Ver 3.0