jugaadlang 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- jugaadlang-1.0.0/LICENSE +21 -0
- jugaadlang-1.0.0/PKG-INFO +363 -0
- jugaadlang-1.0.0/README.md +318 -0
- jugaadlang-1.0.0/jug_cli/__init__.py +2 -0
- jugaadlang-1.0.0/jug_cli/main.py +243 -0
- jugaadlang-1.0.0/jugaadlang/__init__.py +5 -0
- jugaadlang-1.0.0/jugaadlang/ast_nodes/__init__.py +4 -0
- jugaadlang-1.0.0/jugaadlang/ast_nodes/nodes.py +517 -0
- jugaadlang-1.0.0/jugaadlang/errors/__init__.py +14 -0
- jugaadlang-1.0.0/jugaadlang/errors/messages.py +184 -0
- jugaadlang-1.0.0/jugaadlang/lexer/__init__.py +5 -0
- jugaadlang-1.0.0/jugaadlang/lexer/lexer.py +481 -0
- jugaadlang-1.0.0/jugaadlang/lexer/tokens.py +214 -0
- jugaadlang-1.0.0/jugaadlang/package_manager/__init__.py +4 -0
- jugaadlang-1.0.0/jugaadlang/package_manager/manager.py +180 -0
- jugaadlang-1.0.0/jugaadlang/parser/__init__.py +4 -0
- jugaadlang-1.0.0/jugaadlang/parser/parser.py +1225 -0
- jugaadlang-1.0.0/jugaadlang/repl/__init__.py +4 -0
- jugaadlang-1.0.0/jugaadlang/repl/repl.py +139 -0
- jugaadlang-1.0.0/jugaadlang/runtime/__init__.py +4 -0
- jugaadlang-1.0.0/jugaadlang/runtime/interpreter.py +245 -0
- jugaadlang-1.0.0/jugaadlang/stdlib/__init__.py +2 -0
- jugaadlang-1.0.0/jugaadlang/stdlib/catfacts.py +17 -0
- jugaadlang-1.0.0/jugaadlang/stdlib/chai.py +22 -0
- jugaadlang-1.0.0/jugaadlang/stdlib/crypto.py +25 -0
- jugaadlang-1.0.0/jugaadlang/stdlib/crypto_module.py +4 -0
- jugaadlang-1.0.0/jugaadlang/stdlib/database.py +189 -0
- jugaadlang-1.0.0/jugaadlang/stdlib/faili.py +46 -0
- jugaadlang-1.0.0/jugaadlang/stdlib/fortune.py +17 -0
- jugaadlang-1.0.0/jugaadlang/stdlib/ganit.py +46 -0
- jugaadlang-1.0.0/jugaadlang/stdlib/jokes.py +19 -0
- jugaadlang-1.0.0/jugaadlang/stdlib/json.py +34 -0
- jugaadlang-1.0.0/jugaadlang/stdlib/memes.py +35 -0
- jugaadlang-1.0.0/jugaadlang/stdlib/motivation.py +18 -0
- jugaadlang-1.0.0/jugaadlang/stdlib/samay.py +29 -0
- jugaadlang-1.0.0/jugaadlang/stdlib/tantra.py +19 -0
- jugaadlang-1.0.0/jugaadlang/stdlib/web.py +173 -0
- jugaadlang-1.0.0/jugaadlang/transformer/__init__.py +4 -0
- jugaadlang-1.0.0/jugaadlang/transformer/to_python.py +508 -0
- jugaadlang-1.0.0/jugaadlang.egg-info/PKG-INFO +363 -0
- jugaadlang-1.0.0/jugaadlang.egg-info/SOURCES.txt +49 -0
- jugaadlang-1.0.0/jugaadlang.egg-info/dependency_links.txt +1 -0
- jugaadlang-1.0.0/jugaadlang.egg-info/entry_points.txt +2 -0
- jugaadlang-1.0.0/jugaadlang.egg-info/requires.txt +20 -0
- jugaadlang-1.0.0/jugaadlang.egg-info/top_level.txt +2 -0
- jugaadlang-1.0.0/pyproject.toml +87 -0
- jugaadlang-1.0.0/setup.cfg +4 -0
- jugaadlang-1.0.0/tests/test_errors.py +69 -0
- jugaadlang-1.0.0/tests/test_lexer.py +80 -0
- jugaadlang-1.0.0/tests/test_parser.py +199 -0
- jugaadlang-1.0.0/tests/test_runtime.py +293 -0
jugaadlang-1.0.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 JugaadLang Community
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,363 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: jugaadlang
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: JugaadLang — A Hindi-keyword programming language for Indian developers
|
|
5
|
+
Author-email: JugaadLang Community <jugaadlang@atomicmail.io>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://jugaadlang.dev
|
|
8
|
+
Project-URL: Repository, https://github.com/jugaadlang/jugaadlang
|
|
9
|
+
Project-URL: Documentation, https://docs.jugaadlang.dev
|
|
10
|
+
Project-URL: Bug Tracker, https://github.com/jugaadlang/jugaadlang/issues
|
|
11
|
+
Keywords: programming-language,hindi,compiler,transpiler,jugaad,indian
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
17
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
18
|
+
Classifier: Operating System :: OS Independent
|
|
19
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
20
|
+
Classifier: Intended Audience :: Developers
|
|
21
|
+
Classifier: Intended Audience :: Education
|
|
22
|
+
Classifier: Topic :: Software Development :: Compilers
|
|
23
|
+
Classifier: Topic :: Software Development :: Interpreters
|
|
24
|
+
Requires-Python: >=3.10
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
License-File: LICENSE
|
|
27
|
+
Requires-Dist: prompt_toolkit>=3.0
|
|
28
|
+
Requires-Dist: pygments>=2.17
|
|
29
|
+
Requires-Dist: rich>=13.0
|
|
30
|
+
Requires-Dist: click>=8.1
|
|
31
|
+
Requires-Dist: requests>=2.31
|
|
32
|
+
Provides-Extra: web
|
|
33
|
+
Requires-Dist: httpx>=0.27; extra == "web"
|
|
34
|
+
Requires-Dist: aiohttp>=3.9; extra == "web"
|
|
35
|
+
Requires-Dist: flask>=3.0; extra == "web"
|
|
36
|
+
Provides-Extra: dev
|
|
37
|
+
Requires-Dist: pytest>=7.4; extra == "dev"
|
|
38
|
+
Requires-Dist: pytest-cov>=4.1; extra == "dev"
|
|
39
|
+
Requires-Dist: black>=23.0; extra == "dev"
|
|
40
|
+
Requires-Dist: mypy>=1.6; extra == "dev"
|
|
41
|
+
Requires-Dist: ruff>=0.1; extra == "dev"
|
|
42
|
+
Provides-Extra: all
|
|
43
|
+
Requires-Dist: jugaadlang[dev,web]; extra == "all"
|
|
44
|
+
Dynamic: license-file
|
|
45
|
+
|
|
46
|
+
# JugaadLang 🇮🇳
|
|
47
|
+
> Code karo Hindi mein, Duniya hila do! 🚀
|
|
48
|
+
|
|
49
|
+
JugaadLang is a modern, beginner-friendly, fun programming language inspired by Python, designed for Indian developers. It replaces Python's core keywords with English-spelled Hindi (Roman Hindi) terms and features custom funny error diagnostic outputs, a built-in package manager, and standard libraries.
|
|
50
|
+
|
|
51
|
+
JugaadLang transpiles directly to native Python AST, meaning it runs with zero runtime performance overhead and provides full compatibility with the entire Python ecosystem.
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
[](https://github.com/JugaadLang/jugaadlang/actions/workflows/ci.yml)
|
|
55
|
+
[](https://github.com/JugaadLang/jugaadlang/actions/workflows/release.yml)
|
|
56
|
+
[](https://github.com/JugaadLang/jugaadlang/actions/workflows/github-code-scanning/codeql)
|
|
57
|
+
|
|
58
|
+
## Table of Contents
|
|
59
|
+
1. [Core Philosophy](#core-philosophy)
|
|
60
|
+
2. [Installation](#installation)
|
|
61
|
+
3. [Language Keywords Reference](#language-keywords-reference)
|
|
62
|
+
4. [Example Usage](#example-usage)
|
|
63
|
+
5. [Built-in Fun Functions](#built-in-fun-functions)
|
|
64
|
+
6. [Ecosystem & Tooling](#ecosystem--tooling)
|
|
65
|
+
- [CLI Runner](#cli-runner)
|
|
66
|
+
- [Interactive REPL](#interactive-repl)
|
|
67
|
+
- [Package Manager](#package-manager)
|
|
68
|
+
- [VS Code Extension](#vs-code-extension)
|
|
69
|
+
7. [Standard Library (Stdlib)](#standard-library-stdlib)
|
|
70
|
+
8. [Funny Error System](#funny-error-system)
|
|
71
|
+
9. [Automated Testing](#automated-testing)
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## Core Philosophy
|
|
76
|
+
1. **Python simplicity:** Clear, indentation-based block syntax.
|
|
77
|
+
2. **Hindi-English keywords:** Express logic in the language you think in.
|
|
78
|
+
3. **Humorous diagnostics:** Error messages that make you laugh, not crash.
|
|
79
|
+
4. **Zero-overhead transpilation:** Compiles to Python bytecode and executes in the native Python VM.
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## Installation
|
|
84
|
+
|
|
85
|
+
To install JugaadLang locally:
|
|
86
|
+
```bash
|
|
87
|
+
# Clone the repository
|
|
88
|
+
git clone https://github.com/jugaadlang/jugaadlang.git
|
|
89
|
+
cd jugaadlang
|
|
90
|
+
|
|
91
|
+
# Install in editable mode (or standard install)
|
|
92
|
+
pip install -e .
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Verify that the CLI works:
|
|
96
|
+
```bash
|
|
97
|
+
jug --version
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## Language Keywords Reference
|
|
103
|
+
|
|
104
|
+
| Python Keyword | JugaadLang | Hindi Literal Meaning |
|
|
105
|
+
| :--- | :--- | :--- |
|
|
106
|
+
| `print` | `bolo` | Say / Speak |
|
|
107
|
+
| `input` | `poochho` | Ask |
|
|
108
|
+
| `if` | `agar` | If |
|
|
109
|
+
| `elif` | `shayad` | Maybe / Perhaps |
|
|
110
|
+
| `else` | `warna` | Otherwise |
|
|
111
|
+
| `for` | `ghumo` | Iterate / Roam |
|
|
112
|
+
| `while` | `jabtak` | Until / As long as |
|
|
113
|
+
| `def` | `banao` | Create / Make |
|
|
114
|
+
| `return` | `wapas` | Return / Back |
|
|
115
|
+
| `class` | `ustad` | Master / Teacher |
|
|
116
|
+
| `self` | `khud` | Self |
|
|
117
|
+
| `import` | `lao` | Import / Bring |
|
|
118
|
+
| `from` | `se` | From |
|
|
119
|
+
| `break` | `rukja` | Stop! |
|
|
120
|
+
| `continue` | `chalte_raho` | Keep going |
|
|
121
|
+
| `try` | `koshish` | Try / Attempt |
|
|
122
|
+
| `except` | `gadbad` | Problem / Exception |
|
|
123
|
+
| `finally` | `aakhir_me` | In the end |
|
|
124
|
+
| `raise` | `udao` | Throw / Raise |
|
|
125
|
+
| `True` | `sahi` | Correct / True |
|
|
126
|
+
| `False` | `galat` | Wrong / False |
|
|
127
|
+
| `None` | `kuch_nahi` | Nothing / None |
|
|
128
|
+
| `and` | `aur` | And |
|
|
129
|
+
| `or` | `ya` | Or |
|
|
130
|
+
| `not` | `nahi` | Not |
|
|
131
|
+
| `async` | `tez` | Fast / Async |
|
|
132
|
+
| `await` | `intezaar` | Wait / Await |
|
|
133
|
+
| `yield` | `baanto` | Distribute / Yield |
|
|
134
|
+
| `pass` | `theek_hai` | Fine / Pass |
|
|
135
|
+
| `global` | `sabka` | Everyone's / Global |
|
|
136
|
+
| `lambda` | `chota_funkshan` | Little function |
|
|
137
|
+
| `in` | `mein` | In |
|
|
138
|
+
| `is` | `hai` | Is |
|
|
139
|
+
| `match` | `agar_match` | Pattern match subject block |
|
|
140
|
+
| `case` | `kaand` | Case block in pattern match |
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
## Standard Built-in Function Mappings
|
|
145
|
+
|
|
146
|
+
JugaadLang supports Roman Hindi wrappers for standard Python built-in functions. They map directly to Python's built-ins:
|
|
147
|
+
|
|
148
|
+
| Python Built-in | JugaadLang | Hindi Translation | Description |
|
|
149
|
+
| :--- | :--- | :--- | :--- |
|
|
150
|
+
| `abs` | `maan` | Value / Magnitude | Absolute value of a number |
|
|
151
|
+
| `all` | `sab` | All | True if all items in iterable are true |
|
|
152
|
+
| `any` | `koi_bhi` | Any / Anyone | True if any item in iterable is true |
|
|
153
|
+
| `bin` | `binary` | Binary | Binary representation of an integer |
|
|
154
|
+
| `bool` | `satyata` | Truth value | Evaluates boolean value |
|
|
155
|
+
| `callable` | `bulaane_yogya` | Callable | Checks if object is callable |
|
|
156
|
+
| `chr` | `akshar` | Character | Returns character from Unicode point |
|
|
157
|
+
| `delattr` | `gun_hatao` | Remove attribute | Deletes attribute from object |
|
|
158
|
+
| `dict` | `kosh` | Dictionary / Lexicon | Returns a dictionary (map) |
|
|
159
|
+
| `divmod` | `bhag_shesh` | Quotient-Remainder | Returns (quotient, remainder) |
|
|
160
|
+
| `enumerate` | `ginti` | Counting / Enumerate | Returns indexed list generator |
|
|
161
|
+
| `exec` | `chalao` | Run / Execute | Executes dynamic Python code |
|
|
162
|
+
| `filter` | `chhano` | Filter | Filters elements through a function |
|
|
163
|
+
| `getattr` | `gun_lao` | Get attribute | Returns attribute value of object |
|
|
164
|
+
| `hasattr` | `gun_hai` | Has attribute | Checks if attribute exists on object |
|
|
165
|
+
| `help` | `madad` | Help | Starts built-in help text utility |
|
|
166
|
+
| `id` | `pehchan` | Identity / ID | Returns unique identity of object |
|
|
167
|
+
| `int` | `purnank` | Integer | Converts value to standard integer |
|
|
168
|
+
| `isinstance` | `prakar_hai` | Is type of | Checks if object is instance of class |
|
|
169
|
+
| `issubclass` | `subclass_hai` | Is subclass of | Checks if class is subclass of another |
|
|
170
|
+
| `len` | `lambaee` | Length | Returns length of a sequence |
|
|
171
|
+
| `list` | `suchi` | List / Sequence | Creates/converts to list |
|
|
172
|
+
| `max` | `adhiktam` | Maximum | Returns largest item |
|
|
173
|
+
| `min` | `nyuntam` | Minimum | Returns smallest item |
|
|
174
|
+
| `next` | `agla` | Next | Retrieves next item from iterator |
|
|
175
|
+
| `object` | `vastu` | Object | Base class object creator |
|
|
176
|
+
| `open` | `kholo` | Open | Opens a file handle |
|
|
177
|
+
| `pow` | `ghat` | Power / Exponent | Raises number to power (x ** y) |
|
|
178
|
+
| `reversed` | `ulta` | Reversed | Returns reversed order iterator |
|
|
179
|
+
| `setattr` | `gun_badlo` | Change attribute | Modifies attribute value of object |
|
|
180
|
+
| `slice` | `tukda` | Slice | Returns slice object for indexes |
|
|
181
|
+
| `sorted` | `kramwar` | Sorted / Sequential | Returns sorted copy of iterable |
|
|
182
|
+
| `str` | `shabd` | String / Word | Converts object to string |
|
|
183
|
+
| `sum` | `yog` | Sum / Addition | Returns sum of items in iterable |
|
|
184
|
+
| `type` | `prakar` | Type / Kind | Returns the type of an object |
|
|
185
|
+
|
|
186
|
+
---
|
|
187
|
+
|
|
188
|
+
## Example Usage
|
|
189
|
+
|
|
190
|
+
### 1. Simple Control Flow (`hello.jug`)
|
|
191
|
+
```jugaadlang
|
|
192
|
+
# Ask for user name
|
|
193
|
+
poochho naam
|
|
194
|
+
|
|
195
|
+
agar naam == "Sumangal":
|
|
196
|
+
bolo("Legend mil gaya! 😎")
|
|
197
|
+
warna:
|
|
198
|
+
bolo("Namaste " + naam)
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
Run it:
|
|
202
|
+
```bash
|
|
203
|
+
jug run hello.jug
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
### 2. Classes & Functions (`oop.jug`)
|
|
207
|
+
```jugaadlang
|
|
208
|
+
ustad Developer:
|
|
209
|
+
banao shuru(khud, naam, language):
|
|
210
|
+
khud.naam = naam
|
|
211
|
+
khud.language = language
|
|
212
|
+
|
|
213
|
+
banao batao(khud):
|
|
214
|
+
bolo(khud.naam + " code likh raha hai " + khud.language + " mein!")
|
|
215
|
+
|
|
216
|
+
dev = Developer("Sumangal", "JugaadLang")
|
|
217
|
+
dev.batao()
|
|
218
|
+
|
|
219
|
+
### 3. Pattern Matching (`match.jug`)
|
|
220
|
+
```jugaadlang
|
|
221
|
+
banao test_match(x):
|
|
222
|
+
agar_match x:
|
|
223
|
+
kaand sahi:
|
|
224
|
+
wapas "boolean true"
|
|
225
|
+
kaand 1:
|
|
226
|
+
wapas "one"
|
|
227
|
+
kaand [a, b]:
|
|
228
|
+
wapas "sequence of " + str(a) + " and " + str(b)
|
|
229
|
+
kaand _:
|
|
230
|
+
wapas "something else"
|
|
231
|
+
|
|
232
|
+
bolo(test_match(1))
|
|
233
|
+
bolo(test_match(sahi))
|
|
234
|
+
bolo(test_match([10, 20]))
|
|
235
|
+
```
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
---
|
|
239
|
+
|
|
240
|
+
## Built-in Fun Functions
|
|
241
|
+
Enjoy several custom interactive built-ins directly at runtime:
|
|
242
|
+
* `chai()`: Prints a warm cup of ASCII tea (`☕ Chai pi lo.`)
|
|
243
|
+
* `himmat()`: Prints a motivational programming boost (`🔥 Hidden feature detected.`)
|
|
244
|
+
* `ghaas_chhoo()`: Gently reminds you to go touch some grass (`🌱 Bahar ghoom aao.`)
|
|
245
|
+
* `bachao()`: Starts a mock search for help (`🚨 StackOverflow search shuru.`)
|
|
246
|
+
* `fortune()`: Tells a programmer's fortune (`🔮 Bug line 347 mein ho sakta hai.`)
|
|
247
|
+
* `jugaad()`: Gives a random hacking/debugging tip.
|
|
248
|
+
* `nazar()`: Blocks bad vibes and bugs (`🧿 Nazar suraksha kavach active! Bad vibes/bugs blocked. 🧿`).
|
|
249
|
+
* `ashirwad()`: Boosts runtime success rate with elder blessings (`👵 Sadbhavna aur aashirwad active! Success rate boosted to 100%! 👵`).
|
|
250
|
+
* `dhanya_waad()`: Expresses polite gratitude (`🙏 Dhanyawaad! Code chalaane ke liye aapka aabhari hoon. Keep coding! 🙏`).
|
|
251
|
+
* `bhagwan_bhala_kare()`: Prays for errors to disappear (`📿 Hey bhagwan, iss error ko apne aap thik kar do! Please! 📿`).
|
|
252
|
+
* `paisa_wasool()`: Reminds you that JugaadLang is free (`💸 Paisa Wasool! JugaadLang is 100% free and open-source, your money is safe! 💸`).
|
|
253
|
+
* `bas_kar_bhai()`: Advises to stop coding and sleep (`🛑 Bas kar bhai! Kitna code likhega? So ja thodi der. 🛑`).
|
|
254
|
+
* `chilla_mat()`: Calms you down during debugging (`🤫 Chilla mat, deep breath le aur debug kar. 🤫`).
|
|
255
|
+
* `kundli()`: Performs astrological diagnostics on your code to see if Shani or Rahu are transit-blocking your variables/loops.
|
|
256
|
+
|
|
257
|
+
---
|
|
258
|
+
|
|
259
|
+
## Ecosystem & Tooling
|
|
260
|
+
|
|
261
|
+
### CLI Runner
|
|
262
|
+
* **Run a file:** `jug run main.jug` (supports script argument passing like `jug run main.jug arg1 arg2`)
|
|
263
|
+
* **Check syntax:** `jug check main.jug`
|
|
264
|
+
* **Static type-checking:** `jug typecheck main.jug` (performs static analysis using `mypy` behind the scenes)
|
|
265
|
+
* **Transpile to Python source:** `jug compile main.jug -o main.py`
|
|
266
|
+
* **Create a boilerplate project:** `jug new my_project`
|
|
267
|
+
|
|
268
|
+
### Interactive REPL
|
|
269
|
+
Launch a beautiful interactive terminal shell:
|
|
270
|
+
```bash
|
|
271
|
+
jug repl
|
|
272
|
+
```
|
|
273
|
+
Features auto-completion for all keywords, live syntax highlighting, input history, and double-Enter multiline block detection.
|
|
274
|
+
|
|
275
|
+
### Package Manager
|
|
276
|
+
Integrate pip packages or custom bundles:
|
|
277
|
+
* **Install:** `jug install web` (installs Flask, requests, httpx, and aiohttp)
|
|
278
|
+
* **Remove:** `jug remove web`
|
|
279
|
+
* **Update:** `jug update web`
|
|
280
|
+
* **Search:** `jug search query`
|
|
281
|
+
|
|
282
|
+
### VS Code Extension
|
|
283
|
+
Launch the extension from `vscode_extension/`. Features full syntax highlighting for `.jug` files, 25+ snippets, hovered keyword documentation in Hindi, and a status bar icon.
|
|
284
|
+
|
|
285
|
+
---
|
|
286
|
+
|
|
287
|
+
## Standard Library (Stdlib)
|
|
288
|
+
|
|
289
|
+
Import standard libraries using `lao` (e.g. `lao ganit`):
|
|
290
|
+
1. **`ganit`**: Hindi wrappers for arithmetic/geometry (e.g. `ganit.sin`, `ganit.pi`, `ganit.sqrt`).
|
|
291
|
+
2. **`web`**: HTTP request wrappers (`web.get`, `web.post`) and **JugaadWeb** framework with `@web.agar_route("/")` and `web.chalao()`.
|
|
292
|
+
3. **`faili`**: Clean file system API (`faili.padho`, `faili.likho`, `faili.jodo`).
|
|
293
|
+
4. **`json`**: Native parser (`json.banao_string`, `json.banao_object`).
|
|
294
|
+
5. **`samay`**: DateTime operations (`samay.abhibhi()`, `samay.aaj()`, `samay.soja()`).
|
|
295
|
+
6. **`tantra`**: Access system variables (`tantra.argv`, `tantra.exit()`, `tantra.platform`).
|
|
296
|
+
7. **`crypto`**: Hash encryption (`crypto.sha256`, `crypto.base64_encode`).
|
|
297
|
+
8. **`database`**: SQLite ORM (**JugaadORM**) backing tables with `bachao()` and `filter()`.
|
|
298
|
+
9. **Fun Libraries**: `chai`, `jokes`, `motivation`, `fortune`, `memes`, `catfacts`.
|
|
299
|
+
|
|
300
|
+
---
|
|
301
|
+
|
|
302
|
+
## Funny Error System
|
|
303
|
+
|
|
304
|
+
Tired of dry Tracebacks? JugaadLang features humorous Hindi exceptions:
|
|
305
|
+
|
|
306
|
+
#### SyntaxError
|
|
307
|
+
```text
|
|
308
|
+
🤦 Bhai kya likh diya?
|
|
309
|
+
Faili: hello.jug Line 3, Col 12
|
|
310
|
+
|
|
311
|
+
agar x ==
|
|
312
|
+
^
|
|
313
|
+
|
|
314
|
+
Error Details: Expected value.
|
|
315
|
+
Keyboard strike par hai kya?
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
#### NameError
|
|
319
|
+
```text
|
|
320
|
+
🕵️ Variable 'x' dhundte dhundte thak gaya.
|
|
321
|
+
Faili: hello.jug Line 12
|
|
322
|
+
|
|
323
|
+
> bolo(x)
|
|
324
|
+
|
|
325
|
+
Kya gadbad hai?
|
|
326
|
+
'x' mila hi nahi.
|
|
327
|
+
|
|
328
|
+
Possible reasons:
|
|
329
|
+
• Typo kiya hai
|
|
330
|
+
• Variable declare karna bhool gaye
|
|
331
|
+
• Universe collapse ho gaya
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
#### DivisionByZero
|
|
335
|
+
```text
|
|
336
|
+
💀 Zero se divide?
|
|
337
|
+
Faili: hello.jug Line 5
|
|
338
|
+
|
|
339
|
+
Kya gadbad hai?
|
|
340
|
+
Newton bhi confuse ho gaya. Maths seekh lo thoda.
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
---
|
|
344
|
+
|
|
345
|
+
## Developer Tooling & Testing
|
|
346
|
+
|
|
347
|
+
For local development and testing, we provide a unified helper script `run.sh` to automate tasks:
|
|
348
|
+
|
|
349
|
+
```bash
|
|
350
|
+
# Clean previous builds, run tests, and perform editable installation
|
|
351
|
+
./run.sh all
|
|
352
|
+
|
|
353
|
+
# Run test suite dynamically under the active Python environment
|
|
354
|
+
./run.sh test
|
|
355
|
+
|
|
356
|
+
# Clean build artifacts and package wheels/tarballs
|
|
357
|
+
./run.sh build
|
|
358
|
+
|
|
359
|
+
# Install JugaadLang locally in editable mode with all development dependencies
|
|
360
|
+
./run.sh install
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
All test cases are written using `pytest` inside the `tests/` directory.
|