nova-pl 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.
Files changed (61) hide show
  1. nova_pl-1.0.0/LICENSE +21 -0
  2. nova_pl-1.0.0/PKG-INFO +426 -0
  3. nova_pl-1.0.0/README.md +380 -0
  4. nova_pl-1.0.0/nova/__init__.py +6 -0
  5. nova_pl-1.0.0/nova/api.py +41 -0
  6. nova_pl-1.0.0/nova/ast/__init__.py +101 -0
  7. nova_pl-1.0.0/nova/ast/base.py +26 -0
  8. nova_pl-1.0.0/nova/ast/expressions.py +148 -0
  9. nova_pl-1.0.0/nova/ast/literals.py +106 -0
  10. nova_pl-1.0.0/nova/ast/statements.py +411 -0
  11. nova_pl-1.0.0/nova/ast/types.py +56 -0
  12. nova_pl-1.0.0/nova/cli.py +124 -0
  13. nova_pl-1.0.0/nova/errors/__init__.py +91 -0
  14. nova_pl-1.0.0/nova/errors/base.py +24 -0
  15. nova_pl-1.0.0/nova/errors/lexer_errors.py +21 -0
  16. nova_pl-1.0.0/nova/errors/parser_errors.py +20 -0
  17. nova_pl-1.0.0/nova/errors/runtime_errors.py +75 -0
  18. nova_pl-1.0.0/nova/errors/type_errors.py +25 -0
  19. nova_pl-1.0.0/nova/interpreter/__init__.py +5 -0
  20. nova_pl-1.0.0/nova/interpreter/base.py +297 -0
  21. nova_pl-1.0.0/nova/interpreter/builtins/__init__.py +0 -0
  22. nova_pl-1.0.0/nova/interpreter/builtins/arrays.py +288 -0
  23. nova_pl-1.0.0/nova/interpreter/builtins/conversion.py +107 -0
  24. nova_pl-1.0.0/nova/interpreter/builtins/input.py +40 -0
  25. nova_pl-1.0.0/nova/interpreter/builtins/intrinsic_array.py +168 -0
  26. nova_pl-1.0.0/nova/interpreter/builtins/intrinsic_math.py +265 -0
  27. nova_pl-1.0.0/nova/interpreter/builtins/intrinsic_random.py +153 -0
  28. nova_pl-1.0.0/nova/interpreter/builtins/intrinsic_stats.py +169 -0
  29. nova_pl-1.0.0/nova/interpreter/builtins/intrinsic_time.py +93 -0
  30. nova_pl-1.0.0/nova/interpreter/builtins/registry.py +129 -0
  31. nova_pl-1.0.0/nova/interpreter/builtins/strings.py +239 -0
  32. nova_pl-1.0.0/nova/interpreter/collections.py +348 -0
  33. nova_pl-1.0.0/nova/interpreter/environment.py +506 -0
  34. nova_pl-1.0.0/nova/interpreter/expressions.py +502 -0
  35. nova_pl-1.0.0/nova/interpreter/interpreter.py +5 -0
  36. nova_pl-1.0.0/nova/interpreter/loop_signals.py +10 -0
  37. nova_pl-1.0.0/nova/interpreter/runtime_values.py +96 -0
  38. nova_pl-1.0.0/nova/interpreter/statements.py +398 -0
  39. nova_pl-1.0.0/nova/interpreter/type_resolver.py +302 -0
  40. nova_pl-1.0.0/nova/lexer/__init__.py +0 -0
  41. nova_pl-1.0.0/nova/lexer/lexer.py +427 -0
  42. nova_pl-1.0.0/nova/lexer/token.py +25 -0
  43. nova_pl-1.0.0/nova/lexer/token_types.py +82 -0
  44. nova_pl-1.0.0/nova/modules/__init__.py +0 -0
  45. nova_pl-1.0.0/nova/modules/loader.py +39 -0
  46. nova_pl-1.0.0/nova/modules/resolver.py +90 -0
  47. nova_pl-1.0.0/nova/parser/__init__.py +0 -0
  48. nova_pl-1.0.0/nova/parser/parser.py +1695 -0
  49. nova_pl-1.0.0/nova/pipeline.py +28 -0
  50. nova_pl-1.0.0/nova/stdlibs/array.nova +19 -0
  51. nova_pl-1.0.0/nova/stdlibs/math.nova +33 -0
  52. nova_pl-1.0.0/nova/stdlibs/random.nova +19 -0
  53. nova_pl-1.0.0/nova/stdlibs/stats.nova +19 -0
  54. nova_pl-1.0.0/nova/stdlibs/time.nova +15 -0
  55. nova_pl-1.0.0/nova_pl.egg-info/PKG-INFO +426 -0
  56. nova_pl-1.0.0/nova_pl.egg-info/SOURCES.txt +59 -0
  57. nova_pl-1.0.0/nova_pl.egg-info/dependency_links.txt +1 -0
  58. nova_pl-1.0.0/nova_pl.egg-info/entry_points.txt +2 -0
  59. nova_pl-1.0.0/nova_pl.egg-info/top_level.txt +1 -0
  60. nova_pl-1.0.0/pyproject.toml +59 -0
  61. nova_pl-1.0.0/setup.cfg +4 -0
nova_pl-1.0.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Varun Dubey
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.
nova_pl-1.0.0/PKG-INFO ADDED
@@ -0,0 +1,426 @@
1
+ Metadata-Version: 2.4
2
+ Name: nova-pl
3
+ Version: 1.0.0
4
+ Summary: A simple, modern, statically-typed programming language implemented in Python.
5
+ Author-email: Varun Dubey <varundubey963@gmail.com>
6
+ Maintainer-email: Varun Dubey <varundubey963@gmail.com>
7
+ License: MIT License
8
+
9
+ Copyright (c) 2026 Varun Dubey
10
+
11
+ Permission is hereby granted, free of charge, to any person obtaining a copy
12
+ of this software and associated documentation files (the "Software"), to deal
13
+ in the Software without restriction, including without limitation the rights
14
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15
+ copies of the Software, and to permit persons to whom the Software is
16
+ furnished to do so, subject to the following conditions:
17
+
18
+ The above copyright notice and this permission notice shall be included in all
19
+ copies or substantial portions of the Software.
20
+
21
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
+ SOFTWARE.
28
+
29
+ Project-URL: Homepage, https://nova.varundubey.dev
30
+ Project-URL: Documentation, https://nova.varundubey.dev/docs
31
+ Project-URL: Repository, https://github.com/varundubey-dev/nova
32
+ Project-URL: Issues, https://github.com/varundubey-dev/nova/issues
33
+ Keywords: nova,programming-language,interpreter,compiler,language,statically-typed
34
+ Classifier: Development Status :: 5 - Production/Stable
35
+ Classifier: Intended Audience :: Developers
36
+ Classifier: License :: OSI Approved :: MIT License
37
+ Classifier: Operating System :: OS Independent
38
+ Classifier: Programming Language :: Python :: 3
39
+ Classifier: Programming Language :: Python :: 3.10
40
+ Classifier: Topic :: Software Development :: Interpreters
41
+ Classifier: Topic :: Software Development :: Compilers
42
+ Requires-Python: >=3.10
43
+ Description-Content-Type: text/markdown
44
+ License-File: LICENSE
45
+ Dynamic: license-file
46
+
47
+ <div align="center">
48
+
49
+ # NOVA
50
+
51
+ *A simple, modern, statically-typed programming language implemented in Python.*
52
+
53
+ [![Version](https://img.shields.io/badge/version-v1.0-blue.svg)](https://github.com/varundubey-dev/nova/releases)
54
+ [![Python](https://img.shields.io/badge/python-3.13+-3776AB.svg?logo=python&logoColor=white)](https://www.python.org/)
55
+ [![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
56
+ [![Status](https://img.shields.io/badge/status-Stable-success.svg)](docs/releases/v1.0.0.md)
57
+ [![Interpreter](https://img.shields.io/badge/runtime-Tree--Walk-orange.svg)](docs/syntax/_CURRENT_.md)
58
+
59
+ <p>
60
+
61
+ <a href="#-features">Features</a> •
62
+ <a href="#-implemented-components">Implementation</a> •
63
+ <a href="#-documentation">Documentation</a> •
64
+ <a href="#-installation">Installation</a> •
65
+ <a href="#-try-nova">Try NOVA</a> •
66
+ <a href="https://nova.varundubey.dev">Website</a>
67
+
68
+ </p>
69
+
70
+ NOVA is a statically-typed programming language built entirely from scratch using a handwritten lexer, recursive-descent parser, abstract syntax tree (AST), module system, and tree-walk interpreter.
71
+
72
+ The project demonstrates the complete implementation of a programming language—from lexical analysis to runtime execution—while remaining approachable enough to study, extend, and experiment with.
73
+
74
+ </div>
75
+
76
+ ---
77
+
78
+ # ✨ Features
79
+
80
+ - Modern statically-typed language
81
+ - Clean and readable syntax
82
+ - Rich primitive and collection types
83
+ - Runtime type checking
84
+ - Schema-based structured data
85
+ - User-defined functions
86
+ - Recursion
87
+ - Module system
88
+ - Import / Export support
89
+ - Standard Library
90
+ - Built-in functions
91
+ - Command-line interface
92
+ - Comprehensive documentation
93
+ - Hundreds of runnable examples
94
+
95
+ ---
96
+
97
+ # ⚙️ Implemented Components
98
+
99
+ - Handwritten Lexer
100
+ - Recursive-Descent Parser
101
+ - Abstract Syntax Tree (AST)
102
+ - Runtime Type System
103
+ - Tree-Walk Interpreter
104
+ - Module Loader
105
+ - Module Resolver
106
+ - Circular Import Detection
107
+ - Standard Library
108
+ - Built-in Function System
109
+ - CLI
110
+ - Source-aware Diagnostic System
111
+
112
+ ---
113
+
114
+ # 🚀 Example
115
+
116
+ ```nova
117
+ import math
118
+ import stats
119
+ import random
120
+
121
+ User: M = {
122
+ name: S,
123
+ scores: [N]
124
+ }
125
+
126
+ student: User = {
127
+ name = "Varun",
128
+ scores = [
129
+ 92,
130
+ 87,
131
+ 95
132
+ ]
133
+ }
134
+
135
+ print(student.name)
136
+
137
+ print(
138
+ "Average:",
139
+ stats.mean(student.scores)
140
+ )
141
+
142
+ print(
143
+ "Square:",
144
+ math.pow(5, 2)
145
+ )
146
+
147
+ print(
148
+ "Lucky Number:",
149
+ random.randint(
150
+ 1,
151
+ 10
152
+ )
153
+ )
154
+ ```
155
+
156
+ Output
157
+
158
+ ```text
159
+ Varun
160
+ Average: 91.33333333333333
161
+ Square: 25
162
+ Lucky Number: 7
163
+ ```
164
+
165
+ ---
166
+
167
+ # 🏗 Architecture
168
+
169
+ ```text
170
+ Source Code
171
+
172
+
173
+ Handwritten Lexer
174
+
175
+
176
+ Recursive-Descent Parser
177
+
178
+
179
+ Abstract Syntax Tree
180
+
181
+
182
+ Module Resolution
183
+
184
+
185
+ Tree-Walk Interpreter
186
+
187
+
188
+ Runtime Values
189
+ ```
190
+
191
+ ---
192
+
193
+ # 📚 Documentation
194
+
195
+ The repository contains complete language documentation covering every released version.
196
+
197
+ ## Language
198
+
199
+ | Documentation | Description |
200
+ |--------------|-------------|
201
+ | [`Language Specification`](docs/syntax/_CURRENT_.md) | Complete language reference |
202
+ | [`Release Notes`](docs/releases/) | Detailed release history |
203
+ | [`Changelog`](docs/releases/_CHANGELOG_.md) | Version overview |
204
+
205
+ ---
206
+
207
+ ## Standard Library
208
+
209
+ | Module | Documentation |
210
+ |---------|---------------|
211
+ | Math | [`math.md`](docs/stdlib/math.md) |
212
+ | Array | [`array.md`](docs/stdlib/array.md) |
213
+ | Random | [`random.md`](docs/stdlib/random.md) |
214
+ | Statistics | [`stats.md`](docs/stdlib/stats.md) |
215
+ | Time | [`time.md`](docs/stdlib/time.md) |
216
+
217
+ Complete Reference
218
+
219
+ - [`Standard Library Index`](docs/stdlib/_INDEX_.md)
220
+
221
+ ---
222
+
223
+ ## Built-in Functions
224
+
225
+ Documentation
226
+
227
+ - [`Built-in Function Index`](docs/builtins/_INDEX_.md)
228
+
229
+ Available Categories
230
+
231
+ - Arrays
232
+ - Strings
233
+ - Input
234
+ - Type Conversion
235
+
236
+ ---
237
+
238
+ ## Examples
239
+
240
+ Every language release includes runnable demonstrations and error cases.
241
+
242
+ ```text
243
+ examples/
244
+
245
+ ├── v0.1
246
+ ├── v0.2
247
+ ├── v0.3
248
+ ├── v0.4
249
+ ├── v0.5
250
+ ├── v0.6
251
+ ├── v0.7
252
+ ├── v0.8
253
+ ├── v0.9
254
+ └── v1.0
255
+ ```
256
+
257
+ ---
258
+
259
+ # 📦 Installation
260
+
261
+ ## Requirements
262
+
263
+ - Python >= 3.13
264
+
265
+ ## Install from PyPI
266
+
267
+ Install the latest stable release.
268
+
269
+ ```bash
270
+ pip install nova-lang
271
+ ```
272
+
273
+ Verify the installation.
274
+
275
+ ```bash
276
+ nova --version
277
+ ```
278
+
279
+ Run a NOVA program.
280
+
281
+ ```bash
282
+ nova hello.nova
283
+ ```
284
+
285
+ ---
286
+
287
+ ## Build from Source
288
+
289
+ Clone the repository.
290
+
291
+ ```bash
292
+ git clone https://github.com/varundubey-dev/nova.git
293
+
294
+ cd nova
295
+ ```
296
+
297
+ Install the development version.
298
+
299
+ ```bash
300
+ pip install .
301
+ ```
302
+
303
+ Or install in editable mode while contributing to NOVA.
304
+
305
+ ```bash
306
+ pip install -e .
307
+ ```
308
+
309
+ ---
310
+
311
+ # 🏛 Repository Layout
312
+
313
+ ```text
314
+ nova/
315
+
316
+ ├── lexer/
317
+ ├── parser/
318
+ ├── ast/
319
+ ├── interpreter/
320
+ ├── modules/
321
+ ├── stdlibs/
322
+ ├── api.py
323
+ └── cli.py
324
+
325
+ docs/
326
+ ├── syntax/
327
+ ├── stdlib/
328
+ ├── builtins/
329
+ └── releases/
330
+
331
+ examples/
332
+ ├── v0.1
333
+ ├── ...
334
+ └── v1.0
335
+ ```
336
+
337
+ ---
338
+
339
+ # 📈 Evolution
340
+
341
+ ```text
342
+ v0.1 ── Core Language
343
+
344
+
345
+ v0.2 ── Primitive Type System
346
+
347
+
348
+ v0.3 ── Arrays
349
+
350
+
351
+ v0.4 ── Schema Maps
352
+
353
+
354
+ v0.5 ── Control Flow
355
+
356
+ ├── v0.5.1 Multi-expression print()
357
+
358
+ v0.6 ── Iteration & Loops
359
+
360
+ ├── v0.6.1 break / continue
361
+
362
+ v0.7 ── User-defined Functions
363
+
364
+
365
+ v0.8 ── Built-in Functions
366
+
367
+
368
+ v0.9 ── Module System
369
+
370
+
371
+ v1.0 ── Standard Library
372
+ ```
373
+
374
+ ---
375
+
376
+ # 🌐 Official Website
377
+
378
+ The NOVA website provides everything needed to learn, explore, and experiment with the language directly in your browser.
379
+
380
+ | Resource | Link | Description |
381
+ |----------|------|-------------|
382
+ | 🏠 Home | `https://nova.varundubey.dev` | Project homepage |
383
+ | 🚀 Playground | `https://nova.varundubey.dev/playground` | Run NOVA programs online |
384
+ | 📖 Documentation | `https://nova.varundubey.dev/docs` | Complete language documentation |
385
+ | 📚 Standard Library | `https://nova.varundubey.dev/docs/stdlib` | Standard Library reference |
386
+ | 🔧 Built-in Functions | `https://nova.varundubey.dev/docs/builtins` | Built-in function reference |
387
+ | 💡 Examples | `https://nova.varundubey.dev/examples` | Interactive examples |
388
+ | 📰 Release Notes | `https://nova.varundubey.dev/releases` | Complete release history |
389
+
390
+ ---
391
+
392
+ # 💻 Try NOVA
393
+
394
+ ### Run Locally
395
+
396
+ ```bash
397
+ git clone https://github.com/varundubey-dev/nova.git
398
+
399
+ cd nova
400
+
401
+ pip install .
402
+
403
+ nova hello.nova
404
+ ```
405
+
406
+ ### Run in Your Browser
407
+
408
+ Visit the NOVA Playground.
409
+
410
+ ```text
411
+ https://nova.varundubey.dev/playground
412
+ ```
413
+
414
+ No installation required.
415
+
416
+ ---
417
+
418
+ <div align="center">
419
+
420
+ ### ⭐ If you found NOVA interesting, consider starring the repository!
421
+
422
+ Built from scratch in Python.
423
+
424
+ Made by **Varun Dubey**
425
+
426
+ </div>