ipp-lang 1.4.2__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.
ipp_lang-1.4.2/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Ipp Language
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,502 @@
1
+ Metadata-Version: 2.4
2
+ Name: ipp-lang
3
+ Version: 1.4.2
4
+ Summary: A beginner-friendly scripting language for game development
5
+ Author: authorss81
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/authorss81/Ipp
8
+ Project-URL: Documentation, https://github.com/authorss81/Ipp/blob/main/TUTORIAL.md
9
+ Project-URL: Repository, https://github.com/authorss81/Ipp
10
+ Project-URL: Bug Tracker, https://github.com/authorss81/Ipp/issues
11
+ Keywords: language,interpreter,game,scripting,vm,bytecode
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.8
17
+ Classifier: Programming Language :: Python :: 3.9
18
+ Classifier: Programming Language :: Python :: 3.10
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Topic :: Software Development :: Interpreters
22
+ Classifier: Topic :: Games/Entertainment
23
+ Requires-Python: >=3.8
24
+ Description-Content-Type: text/markdown
25
+ License-File: LICENSE
26
+ Dynamic: license-file
27
+
28
+ <div align="center">
29
+
30
+ # Ipp Language
31
+
32
+ <img src="https://img.shields.io/badge/version-1.4.0-blue.svg" alt="Version">
33
+ <img src="https://img.shields.io/badge/python-3.8+-green.svg" alt="Python">
34
+ <img src="https://img.shields.io/badge/license-MIT-orange.svg" alt="License">
35
+ <img src="https://img.shields.io/badge/builtins-132+-brightgreen.svg" alt="Builtins">
36
+ <img src="https://img.shields.io/badge/tests-46%20passing-brightgreen.svg" alt="Tests">
37
+ <img src="https://img.shields.io/badge/status-stable-green.svg" alt="Status">
38
+
39
+ **A beginner-friendly scripting language for game development.**
40
+ Python-like syntax · Closures · Classes with Inheritance · Pattern Matching · Bytecode VM · World-Class REPL
41
+
42
+ </div>
43
+
44
+ ---
45
+
46
+ ## What is Ipp?
47
+
48
+ Ipp is a dynamically-typed, interpreted scripting language designed to feel like Python and Lua combined, built specifically for game development scripting. It compiles to a custom bytecode VM and also runs on a tree-walking interpreter for rapid development.
49
+
50
+ **v1.4.0** includes 132+ built-in functions, 46 passing regression tests, generator functions (`yield`), a world-class REPL with tab completion, debugging, session management, and comprehensive standard library coverage including HTTP/FTP/SMTP networking, data formats, math, collections, and game primitives.
51
+
52
+ ---
53
+
54
+ ## Quick Start
55
+
56
+ ```bash
57
+ # Clone the repo
58
+ git clone https://github.com/authorss81/Ipp
59
+ cd Ipp
60
+
61
+ # Run a script
62
+ python main.py examples/hello_world.ipp
63
+
64
+ # Start the REPL
65
+ python main.py
66
+ ```
67
+
68
+ No dependencies required. Python 3.8+ only.
69
+
70
+ ---
71
+
72
+ ## REPL Features
73
+
74
+ Ipp has a world-class REPL with 30+ built-in commands:
75
+
76
+ ```
77
+ ██╗██████╗ ██████╗
78
+ ██║██╔══██╗██╔══██╗
79
+ ██║██████╔╝██████╔╝
80
+ ██║██╔═══╝ ██╔═══╝
81
+ ██║██║ ██║
82
+ ╚═╝╚═╝ ╚═╝
83
+
84
+ Ipp v1.3.10
85
+ A scripting language for game development
86
+ ──────────────────────────────────────────
87
+ ❯ var x = 2 ** 10
88
+ → 1024 0.1ms
89
+
90
+ ❯ var name = "World"
91
+ ❯ print("Hello, " + name + "!")
92
+ Hello, World!
93
+ ```
94
+
95
+ ### Tab Completion
96
+ - **Builtins**: Type `ht` + Tab → `http_get`, `http_post`, `http_put`, etc.
97
+ - **Variables**: Type `my` + Tab → `my_variable`, etc.
98
+ - **Dict keys**: Type `person["` + Tab → `name`, `age`, `city`
99
+ - **Fuzzy matching**: `htgt` → `http_get`, `http_put`
100
+ - **REPL commands**: `.h` + Tab → `.help`, `.history`
101
+
102
+ ### REPL Commands
103
+
104
+ | Category | Commands |
105
+ |----------|----------|
106
+ | **Core** | `.help`, `.vars`, `.fns`, `.builtins`, `.modules`, `.types`, `.version`, `.clear` |
107
+ | **Session** | `.load`, `.save`, `.export`, `.session save/load/clear/export`, `.sessions` |
108
+ | **History** | `.history`, `.last`, `$_`, `.history $_` |
109
+ | **Undo/Redo** | `.undo`, `.redo` |
110
+ | **Debugging** | `.debug start/stop`, `.break <line>`, `.watch <expr>`, `.locals`, `.stack` |
111
+ | **Inspection** | `.which <name>`, `.doc <fn>`, `.pretty <expr>`, `.json <expr>`, `.table <var>` |
112
+ | **Performance** | `.time <expr>`, `.profile` |
113
+ | **Shell** | `! <cmd>`, `.pipe <cmd>`, `.cd <dir>`, `.ls [dir]`, `.pwd` |
114
+ | **Customization** | `.theme dark/light/solarized`, `.prompt dir/time/full`, `.alias`, `.bind` |
115
+ | **Code** | `.edit`, `.format <expr>`, `.search <kw>`, `.examples`, `.tutorial`, `.plugin load` |
116
+
117
+ ### Prompt Customization
118
+ - `.prompt ipp` — Default prompt (`❯`)
119
+ - `.prompt dir` — Show current directory (`(Ipp) ❯`)
120
+ - `.prompt time` — Show current time (`[14:30:00] ❯`)
121
+ - `.prompt full` — Show time + directory (`[14:30:00] C:\Ipp ❯`)
122
+
123
+ ### Color Themes
124
+ - `.theme dark` — Dark theme (default)
125
+ - `.theme light` — Light theme
126
+ - `.theme solarized` — Solarized theme
127
+
128
+ ---
129
+
130
+ ## Language Tour
131
+
132
+ ### Variables
133
+
134
+ ```ipp
135
+ var x = 10 # mutable
136
+ let y = 20 # immutable binding
137
+ var name: string = "Ipp" # optional type annotation
138
+ ```
139
+
140
+ ### Compound Assignment
141
+
142
+ ```ipp
143
+ var score = 0
144
+ score += 10
145
+ score *= 2
146
+ score -= 5
147
+ ```
148
+
149
+ ### Functions & Closures
150
+
151
+ ```ipp
152
+ func greet(name) {
153
+ return "Hello, " + name
154
+ }
155
+
156
+ # Named arguments
157
+ greet(name="Alice", greeting="Hi")
158
+
159
+ # Closures
160
+ func make_counter() {
161
+ var count = 0
162
+ return func() {
163
+ count = count + 1
164
+ return count
165
+ }
166
+ }
167
+ var counter = make_counter()
168
+ print(counter()) # 1
169
+ print(counter()) # 2
170
+ ```
171
+
172
+ ### Lambda Expressions
173
+
174
+ ```ipp
175
+ var double = func(x) => x * 2
176
+ print(double(5)) # 10
177
+ ```
178
+
179
+ ### Classes & Inheritance
180
+
181
+ ```ipp
182
+ class Animal {
183
+ func init(name) {
184
+ this.name = name
185
+ }
186
+ func speak() {
187
+ print(this.name + " makes a sound")
188
+ }
189
+ }
190
+
191
+ class Dog : Animal {
192
+ func speak() {
193
+ print(this.name + " says woof!")
194
+ }
195
+ }
196
+
197
+ var dog = Dog("Rex")
198
+ dog.speak() # Rex says woof!
199
+ ```
200
+
201
+ ### Pattern Matching
202
+
203
+ ```ipp
204
+ var x = 2
205
+ match x {
206
+ case 1 => print("one")
207
+ case 2 => print("two")
208
+ case 3 => print("three")
209
+ default => print("other")
210
+ }
211
+ ```
212
+
213
+ ### Error Handling
214
+
215
+ ```ipp
216
+ try {
217
+ var result = risky_operation()
218
+ } catch e {
219
+ print("Error: " + e)
220
+ } finally {
221
+ print("Cleanup")
222
+ }
223
+ ```
224
+
225
+ ### List Comprehensions
226
+
227
+ ```ipp
228
+ var squares = [x*x for x in 1..10]
229
+ var evens = [x for x in 1..20 if x % 2 == 0]
230
+ ```
231
+
232
+ ### Nullish Coalescing
233
+
234
+ ```ipp
235
+ var name = user_name ?? "Anonymous"
236
+ ```
237
+
238
+ ### Ternary Operator
239
+
240
+ ```ipp
241
+ var status = age >= 18 ? "adult" : "minor"
242
+ ```
243
+
244
+ ### Tuple Unpacking
245
+
246
+ ```ipp
247
+ var a, b = [1, 2]
248
+ print(a) # 1
249
+ print(b) # 2
250
+ ```
251
+
252
+ ### Operator Overloading
253
+
254
+ ```ipp
255
+ class Vector {
256
+ func init(x, y) {
257
+ this.x = x
258
+ this.y = y
259
+ }
260
+ func __add__(other) {
261
+ return Vector(this.x + other.x, this.y + other.y)
262
+ }
263
+ }
264
+ ```
265
+
266
+ ### Custom `__str__` Method
267
+
268
+ ```ipp
269
+ class Point {
270
+ func init(x, y) {
271
+ this.x = x
272
+ this.y = y
273
+ }
274
+ func __str__() {
275
+ return "(" + this.x + ", " + this.y + ")"
276
+ }
277
+ }
278
+ var p = Point(3, 4)
279
+ print(p) # (3, 4)
280
+ ```
281
+
282
+ ---
283
+
284
+ ## Built-in Functions (130+)
285
+
286
+ ### Core (20)
287
+ `print`, `len`, `type`, `input`, `exit`, `assert`, `str`, `int`, `float`, `bool`, `to_number`, `to_int`, `to_float`, `to_bool`, `to_string`, `abs`, `min`, `max`, `sum`, `range`
288
+
289
+ ### Math & Trigonometry (22)
290
+ `sin`, `cos`, `tan`, `asin`, `acos`, `atan`, `atan2`, `log`, `log10`, `degrees`, `radians`, `pi`, `e`, `sqrt`, `pow`, `round`, `floor`, `ceil`, `lerp`, `clamp`, `distance`, `normalize`, `dot`, `cross`, `sign`, `smoothstep`, `move_towards`, `angle`, `factorial`, `gcd`, `lcm`, `hypot`, `floor_div`
291
+
292
+ ### Random (5)
293
+ `random`, `randint`, `randfloat`, `choice`, `shuffle`
294
+
295
+ ### String (18)
296
+ `upper`, `lower`, `strip`, `split`, `join`, `replace`, `replace_all`, `starts_with`, `ends_with`, `find`, `index_of`, `char_at`, `substring`, `count`, `contains`, `split_lines`, `ascii`, `from_ascii`
297
+
298
+ ### File I/O (7)
299
+ `read_file`, `write_file`, `append_file`, `file_exists`, `delete_file`, `list_dir`, `mkdir`
300
+
301
+ ### Data Formats (15)
302
+ `json_parse`, `json_stringify`, `xml_parse`, `xml_to_string`, `yaml_parse`, `yaml_to_string`, `toml_parse`, `toml_to_string`, `csv_parse`, `csv_parse_dict`, `csv_to_string`, `regex_match`, `regex_search`, `regex_replace`, `hash`
303
+
304
+ ### Hashing & Encoding (8)
305
+ `md5`, `sha256`, `sha1`, `sha512`, `base64_encode`, `base64_decode`, `gzip_compress`, `gzip_decompress`
306
+
307
+ ### Collections (12)
308
+ `keys`, `values`, `items`, `has_key`, `set`, `deque`, `ordict`, `PriorityQueue`, `Tree`, `Graph`, `uuid4`, `uuid1`
309
+
310
+ ### Networking (12)
311
+ `http_get`, `http_post`, `http_put`, `http_delete`, `http_request`, `http_serve`, `ftp_connect`, `ftp_disconnect`, `ftp_list`, `ftp_get`, `ftp_put`, `smtp_connect`, `smtp_disconnect`, `smtp_send`
312
+
313
+ ### WebSocket (4)
314
+ `websocket_connect`, `websocket_send`, `websocket_receive`, `websocket_close`
315
+
316
+ ### URL Utilities (6)
317
+ `url_parse`, `url_build`, `url_encode`, `url_decode`, `url_query_parse`, `url_query_build`
318
+
319
+ ### Time & OS (10)
320
+ `time`, `sleep`, `clock`, `datetime`, `os_platform`, `os_cwd`, `env_get`, `env_set`, `path_dirname`, `path_basename`
321
+
322
+ ### Advanced (8)
323
+ `printf`, `sprintf`, `scanf`, `logger`, `thread`, `thread_sleep`, `thread_current`, `argparse`
324
+
325
+ ### Game Types (4)
326
+ `vec2`, `vec3`, `color`, `rect`, `complex`
327
+
328
+ ### Generators (2)
329
+ `next`, `is_generator`
330
+
331
+ ---
332
+
333
+ ## Generators
334
+
335
+ Ipp supports generator functions using the `yield` keyword:
336
+
337
+ ```ipp
338
+ func count_up() {
339
+ var i = 0
340
+ while i < 5 {
341
+ yield i
342
+ i = i + 1
343
+ }
344
+ }
345
+
346
+ var gen = count_up()
347
+ print(next(gen)) # 0
348
+ print(next(gen)) # 1
349
+ print(next(gen)) # 2
350
+ ```
351
+
352
+ ### For-in with Generators
353
+
354
+ ```ipp
355
+ func fibonacci(n) {
356
+ var a = 0
357
+ var b = 1
358
+ var count = 0
359
+ while count < n {
360
+ yield a
361
+ var temp = a
362
+ a = b
363
+ b = temp + b
364
+ count = count + 1
365
+ }
366
+ }
367
+
368
+ for n in fibonacci(10) {
369
+ print(n) # 0, 1, 1, 2, 3, 5, 8, 13, 21, 34
370
+ }
371
+ ```
372
+
373
+ ### Generator Utilities
374
+
375
+ ```ipp
376
+ var gen = count_up()
377
+ print(is_generator(gen)) # true
378
+ print(is_generator(42)) # false
379
+ ```
380
+
381
+ ---
382
+
383
+ ## Standard Library
384
+
385
+ ### HTTP Client
386
+ ```ipp
387
+ var res = http_get("https://httpbin.org/get")
388
+ print(res["status"])
389
+ print(res["body"])
390
+
391
+ var post_res = http_post("https://httpbin.org/post", "data=value")
392
+ ```
393
+
394
+ ### HTTP Server
395
+ ```ipp
396
+ func handler(method, path, headers, body) {
397
+ return (200, {"Content-Type": "text/plain"}, "Hello from Ipp!")
398
+ }
399
+ http_serve(handler, "localhost", 8080)
400
+ ```
401
+
402
+ ### FTP Client
403
+ ```ipp
404
+ var ftp = ftp_connect("ftp.example.com", "user", "pass")
405
+ var files = ftp_list(ftp)
406
+ ftp_get(ftp, "remote.txt", "local.txt")
407
+ ftp_disconnect(ftp)
408
+ ```
409
+
410
+ ### SMTP Email
411
+ ```ipp
412
+ var smtp = smtp_connect("smtp.gmail.com", 587, true, "user@gmail.com", "password")
413
+ smtp_send(smtp, "user@gmail.com", "recipient@example.com", "Subject", "Body")
414
+ smtp_disconnect(smtp)
415
+ ```
416
+
417
+ ### PriorityQueue
418
+ ```ipp
419
+ var pq = PriorityQueue()
420
+ pq.push("low", 3)
421
+ pq.push("high", 1)
422
+ pq.push("medium", 2)
423
+ print(pq.pop()) # high
424
+ print(pq.pop()) # medium
425
+ ```
426
+
427
+ ### Tree
428
+ ```ipp
429
+ var root = Tree("root")
430
+ root.add_child(Tree("child1"))
431
+ root.add_child(Tree("child2"))
432
+ print(root.traverse_preorder())
433
+ print(root.traverse_bfs())
434
+ ```
435
+
436
+ ### Graph
437
+ ```ipp
438
+ var g = Graph()
439
+ g.add_edge("A", "B", 1)
440
+ g.add_edge("B", "C", 2)
441
+ g.add_edge("A", "C", 4)
442
+ print(g.shortest_path("A", "C")) # [A, B, C]
443
+ ```
444
+
445
+ ---
446
+
447
+ ## Version History
448
+
449
+ | Version | Focus |
450
+ |---|---|
451
+ | v1.3.0 | String interpolation, REPL redesign |
452
+ | v1.3.1 | Performance optimization |
453
+ | v1.3.2 | VM upvalues, Set type, bug fixes |
454
+ | v1.3.3 | Bug fixes + Standard Library + Networking (HTTP/FTP/SMTP) |
455
+ | v1.3.4 | Comprehensive stdlib testing (130+ builtins) |
456
+ | v1.3.5 | Regex fix + REPL color fix |
457
+ | v1.3.6 | VM compatibility tests + REPL warning |
458
+ | v1.3.7 | REPL enhancements (.load, .save, .doc, .time, .which, .undo, .profile, .alias, .edit, .last) |
459
+ | v1.3.8 | HTTP Server, WebSocket, PriorityQueue, Tree, Graph |
460
+ | v1.3.9 | REPL error handling (smart suggestions, highlight fix, .colors fix) |
461
+ | v1.3.10 | REPL Intelligence (tab completion, debugger, pretty printing, shell integration, themes) |
462
+ | v1.4.0 | Generator functions (`yield`) + VM Bug Fixes (all 7 VM bugs fixed) |
463
+ | v1.4.1 | Error Documentation + Error Reference Guide |
464
+ | v1.4.2 | Tutorial Documentation + Getting Started Guide |
465
+ | v1.4.3 | PyPI Publishing + `pip install ipp-lang` |
466
+ | v1.5.0 | Async/Await + Coroutines + Event Loop |
467
+ | v1.5.1 | WASM Compilation + Web Playground |
468
+ | v1.5.2 | WebGL Integration + 2D Canvas Rendering |
469
+ | v1.5.3 | 3D Rendering + Scene Graph |
470
+ | v1.6.0 | C++ Integration + Native Extensions |
471
+ | v1.6.1 | Cross-Platform (iOS, macOS, Linux, Windows Installer) |
472
+ | v1.6.2 | Language Server Protocol (LSP) |
473
+ | v1.6.3 | VSCode Extension + IDE Integration |
474
+ | v2.0.0 | Package Manager + Full Ecosystem + Game Engine |
475
+
476
+ ---
477
+
478
+ ## Testing
479
+
480
+ ```bash
481
+ # Run all regression tests
482
+ python tests/regression.py
483
+
484
+ # Run a single test
485
+ python main.py run tests/v1_3_10/test_repl_intelligence.ipp
486
+ ```
487
+
488
+ All 29 test suites pass with zero failures.
489
+
490
+ ---
491
+
492
+ ## Contributing
493
+
494
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
495
+
496
+ Fork → Branch → Fix → Pull Request
497
+
498
+ ---
499
+
500
+ ## License
501
+
502
+ MIT License — see [LICENSE](LICENSE) for details.