Metadata-Version: 2.4
Name: shilp
Version: 0.1.0
Summary: शिल्प — हिन्दी में लिखी जाने वाली, पायथन पर आधारित प्रोग्रामिंग भाषा (A Hindi programming language with Python semantics)
Author: Shilp contributors
License: GPL-3.0-or-later
Project-URL: Homepage, https://github.com/prashlkam/Shilp
Keywords: hindi,india,programming-language,education,python,devanagari
Classifier: Development Status :: 3 - Alpha
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
Classifier: Intended Audience :: Education
Classifier: Natural Language :: Hindi
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development :: Interpreters
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# शिल्प (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](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](SPEC.md).
- Word tables are data ([shilp/shabdkosh/](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](SPEC.md). Examples: [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/](editors/vscode/).
Pygments: `pygmentize -l shilp` works once shilp and pygments are installed.

## License

GPL Ver 3.0
