shell-lite 0.5__tar.gz → 0.5.1__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 (44) hide show
  1. shell_lite-0.5.1/PKG-INFO +478 -0
  2. shell_lite-0.5.1/README.md +463 -0
  3. shell_lite-0.5.1/pyproject.toml +23 -0
  4. {shell_lite-0.5 → shell_lite-0.5.1}/shell_lite/interpreter.py +1 -1
  5. {shell_lite-0.5 → shell_lite-0.5.1}/shell_lite/lexer.py +48 -12
  6. {shell_lite-0.5 → shell_lite-0.5.1}/shell_lite/main.py +1 -1
  7. {shell_lite-0.5 → shell_lite-0.5.1}/shell_lite/parser_gbp.py +26 -13
  8. shell_lite-0.5.1/shell_lite.egg-info/PKG-INFO +478 -0
  9. {shell_lite-0.5 → shell_lite-0.5.1}/shell_lite.egg-info/SOURCES.txt +2 -0
  10. shell_lite-0.5.1/shell_lite.egg-info/requires.txt +1 -0
  11. {shell_lite-0.5 → shell_lite-0.5.1}/shell_lite.egg-info/top_level.txt +0 -1
  12. shell_lite-0.5.1/tests/test_phase1.py +274 -0
  13. shell_lite-0.5/PKG-INFO +0 -93
  14. shell_lite-0.5/README.md +0 -74
  15. shell_lite-0.5/shell_lite.egg-info/PKG-INFO +0 -93
  16. shell_lite-0.5/shell_lite.egg-info/requires.txt +0 -5
  17. {shell_lite-0.5 → shell_lite-0.5.1}/LICENSE +0 -0
  18. {shell_lite-0.5 → shell_lite-0.5.1}/setup.cfg +0 -0
  19. {shell_lite-0.5 → shell_lite-0.5.1}/setup.py +0 -0
  20. {shell_lite-0.5 → shell_lite-0.5.1}/shell_lite/__init__.py +0 -0
  21. {shell_lite-0.5 → shell_lite-0.5.1}/shell_lite/ast_nodes.py +0 -0
  22. {shell_lite-0.5 → shell_lite-0.5.1}/shell_lite/cli.py +0 -0
  23. {shell_lite-0.5 → shell_lite-0.5.1}/shell_lite/compiler.py +0 -0
  24. {shell_lite-0.5 → shell_lite-0.5.1}/shell_lite/js_compiler.py +0 -0
  25. {shell_lite-0.5 → shell_lite-0.5.1}/shell_lite/llvm_backend/__init__.py +0 -0
  26. {shell_lite-0.5 → shell_lite-0.5.1}/shell_lite/llvm_backend/builder.py +0 -0
  27. {shell_lite-0.5 → shell_lite-0.5.1}/shell_lite/llvm_backend/codegen.py +0 -0
  28. {shell_lite-0.5 → shell_lite-0.5.1}/shell_lite/parser.py +0 -0
  29. {shell_lite-0.5 → shell_lite-0.5.1}/shell_lite/runtime.py +0 -0
  30. {shell_lite-0.5 → shell_lite-0.5.1}/shell_lite.egg-info/dependency_links.txt +0 -0
  31. {shell_lite-0.5 → shell_lite-0.5.1}/shell_lite.egg-info/entry_points.txt +0 -0
  32. {shell_lite-0.5 → shell_lite-0.5.1}/tests/__init__.py +0 -0
  33. {shell_lite-0.5 → shell_lite-0.5.1}/tests/benchmark_driver.py +0 -0
  34. {shell_lite-0.5 → shell_lite-0.5.1}/tests/compare_parsers.py +0 -0
  35. {shell_lite-0.5 → shell_lite-0.5.1}/tests/debug_jit.py +0 -0
  36. {shell_lite-0.5 → shell_lite-0.5.1}/tests/generate_actual_graph.py +0 -0
  37. {shell_lite-0.5 → shell_lite-0.5.1}/tests/generate_perf_graph.py +0 -0
  38. {shell_lite-0.5 → shell_lite-0.5.1}/tests/generate_runtime_graph.py +0 -0
  39. {shell_lite-0.5 → shell_lite-0.5.1}/tests/run_jit.py +0 -0
  40. {shell_lite-0.5 → shell_lite-0.5.1}/tests/test_gbp_standalone.py +0 -0
  41. {shell_lite-0.5 → shell_lite-0.5.1}/tests/test_interpreter.py +0 -0
  42. {shell_lite-0.5 → shell_lite-0.5.1}/tests/test_lexer.py +0 -0
  43. {shell_lite-0.5 → shell_lite-0.5.1}/tests/test_parser.py +0 -0
  44. {shell_lite-0.5 → shell_lite-0.5.1}/tests/test_stdlib.py +0 -0
@@ -0,0 +1,478 @@
1
+ Metadata-Version: 2.1
2
+ Name: shell-lite
3
+ Version: 0.5.1
4
+ Summary: A lightweight, English-like scripting language.
5
+ Home-page: https://github.com/Shrey-N/ShellDesk
6
+ Author: Shrey Naithani
7
+ Author-email: Shrey Naithani <contact@shelllite.tech>
8
+ License: MIT
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: Operating System :: OS Independent
11
+ Requires-Python: >=3.8
12
+ Description-Content-Type: text/markdown
13
+ License-File: LICENSE
14
+ Requires-Dist: prompt_toolkit>=3.0.0
15
+
16
+ <img src="assets/logo.png" align="right" width="250" alt="ShellLite Logo" />
17
+
18
+ # ShellLite
19
+
20
+ **The English-Like Programming Language**
21
+
22
+ ShellLite is a modern programming language designed to prioritize human readability. It replaces complex syntax with natural English commands, making software development accessible and maintainable. With version 0.05.0, ShellLite now supports native compilation via LLVM alongside its interpreted mode.
23
+
24
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
25
+ [![Version](https://img.shields.io/badge/version-0.05.0-green.svg)]()
26
+
27
+ ---
28
+
29
+ ## Table of Contents
30
+
31
+ - [Features](#features)
32
+ - [Architecture](#architecture)
33
+ - [Installation](#installation)
34
+ - [Quick Start](#quick-start)
35
+ - [Language Overview](#language-overview)
36
+ - [Compilation](#compilation)
37
+ - [The Three Pillars](#the-three-pillars)
38
+ - [CLI Reference](#cli-reference)
39
+ - [Project Structure](#project-structure)
40
+ - [Documentation](#documentation)
41
+ - [Ecosystem](#ecosystem)
42
+ - [License](#license)
43
+
44
+ ---
45
+
46
+ ## Features
47
+
48
+ | Feature | Description |
49
+ |:--------|:------------|
50
+ | **Natural Syntax** | Write code that reads like English |
51
+ | **Dynamic Typing** | No type declarations required |
52
+ | **Multi-Target Compilation** | Compile to LLVM, JavaScript, or Python |
53
+ | **Python Integration** | Use any Python library via The Bridge |
54
+ | **GUI Framework** | Build desktop apps with The Canvas |
55
+ | **Package Manager** | Manage dependencies with The Universe |
56
+ | **Web Framework** | Built-in HTTP server and routing |
57
+ | **Interactive REPL** | Explore and test code interactively |
58
+
59
+ ---
60
+
61
+ ## Architecture
62
+
63
+ ```mermaid
64
+ flowchart TB
65
+ subgraph Input
66
+ A[Source Code .shl]
67
+ end
68
+
69
+ subgraph Frontend
70
+ B[Lexer]
71
+ C[Parser]
72
+ D[AST]
73
+ end
74
+
75
+ subgraph Backend
76
+ E{Execution Mode}
77
+ F[Interpreter]
78
+ G[LLVM Codegen]
79
+ H[JS Compiler]
80
+ I[Python Transpiler]
81
+ end
82
+
83
+ subgraph Output
84
+ J[Runtime Execution]
85
+ K[Native Binary]
86
+ L[JavaScript File]
87
+ M[Python File]
88
+ end
89
+
90
+ A --> B --> C --> D --> E
91
+ E -->|interpret| F --> J
92
+ E -->|compile llvm| G --> K
93
+ E -->|compile js| H --> L
94
+ E -->|compile python| I --> M
95
+ ```
96
+
97
+ ### Compilation Pipeline
98
+
99
+ ```mermaid
100
+ flowchart LR
101
+ subgraph Lexical Analysis
102
+ A[Source] --> B[Tokens]
103
+ end
104
+
105
+ subgraph Parsing
106
+ B --> C[AST]
107
+ end
108
+
109
+ subgraph Code Generation
110
+ C --> D[LLVM IR]
111
+ D --> E[Optimization]
112
+ E --> F[Native Code]
113
+ end
114
+ ```
115
+
116
+ ---
117
+
118
+ ## Installation
119
+
120
+ ### Via PyPI (Recommended)
121
+
122
+ ```bash
123
+ pip install shell-lite
124
+ ```
125
+
126
+ ### From Source
127
+
128
+ ```bash
129
+ git clone https://github.com/Shrey-N/ShellLite.git
130
+ cd ShellLite
131
+ pip install -e .
132
+ ```
133
+
134
+ ### Windows Installer
135
+
136
+ Download the latest `shl.exe` from the [Releases](https://github.com/Shrey-N/ShellLite/releases) page.
137
+
138
+ ### Verify Installation
139
+
140
+ ```bash
141
+ shl --version
142
+ ```
143
+
144
+ ---
145
+
146
+ ## Quick Start
147
+
148
+ ### Hello World
149
+
150
+ Create a file named `hello.shl`:
151
+
152
+ ```
153
+ say "Hello, World"
154
+ ```
155
+
156
+ Run it:
157
+
158
+ ```bash
159
+ shl hello.shl
160
+ ```
161
+
162
+ ### Interactive REPL
163
+
164
+ ```bash
165
+ shl
166
+ ```
167
+
168
+ ```
169
+ ShellLite REPL - English Syntax
170
+ ========================================
171
+ >>> say "Hello"
172
+ Hello
173
+ >>> 5 + 5
174
+ 10
175
+ >>> exit
176
+ ```
177
+
178
+ ---
179
+
180
+ ## Language Overview
181
+
182
+ ### Type System
183
+
184
+ ```mermaid
185
+ graph TD
186
+ A[ShellLite Types] --> B[Number]
187
+ A --> C[String]
188
+ A --> D[Boolean]
189
+ A --> E[List]
190
+ A --> F[Dictionary]
191
+ A --> G[Function]
192
+ A --> H[Object]
193
+ A --> I[None]
194
+
195
+ B --> B1[Integer]
196
+ B --> B2[Float]
197
+ D --> D1[yes / true]
198
+ D --> D2[no / false]
199
+ ```
200
+
201
+ ### Syntax Examples
202
+
203
+ **Variables and Constants**
204
+ ```
205
+ name = "Alice"
206
+ age = 30
207
+ const PI = 3.14159
208
+ ```
209
+
210
+ **Control Flow**
211
+ ```
212
+ if score > 90
213
+ say "Excellent"
214
+ elif score > 70
215
+ say "Good"
216
+ else
217
+ say "Keep trying"
218
+ ```
219
+
220
+ **Functions**
221
+ ```
222
+ to greet name
223
+ say "Hello, " + name
224
+ give "Greeted " + name
225
+
226
+ result = greet "World"
227
+ ```
228
+
229
+ **Classes**
230
+ ```
231
+ thing Car
232
+ has speed = 0
233
+
234
+ can accelerate amount
235
+ speed += amount
236
+ say "Speed: " + str(speed)
237
+
238
+ my_car = new Car
239
+ my_car.accelerate 50
240
+ ```
241
+
242
+ ### Natural Language Comparisons
243
+
244
+ | Symbol | Natural Form |
245
+ |:------:|:-------------|
246
+ | `==` | `is`, `equals` |
247
+ | `!=` | `is not` |
248
+ | `>` | `is more than` |
249
+ | `<` | `is less than` |
250
+ | `>=` | `is at least` |
251
+ | `<=` | `is at most` |
252
+
253
+ ---
254
+
255
+ ## Compilation
256
+
257
+ ### Compilation Targets
258
+
259
+ ```mermaid
260
+ flowchart LR
261
+ A[script.shl] --> B{shl compile}
262
+ B -->|--target llvm| C[Native Binary]
263
+ B -->|--target js| D[JavaScript]
264
+ B -->|--target python| E[Python]
265
+ ```
266
+
267
+ ### Commands
268
+
269
+ ```bash
270
+ # Compile to native code (default)
271
+ shl compile script.shl
272
+
273
+ # Compile to JavaScript
274
+ shl compile script.shl --target js
275
+
276
+ # Compile to Python
277
+ shl compile script.shl --target python
278
+ ```
279
+
280
+ ### Performance Comparison
281
+
282
+ | Mode | Relative Speed | Use Case |
283
+ |:-----|:---------------|:---------|
284
+ | Interpreted | 1x | Development |
285
+ | Python Compiled | ~1.2x | Integration |
286
+ | JavaScript | ~2-5x | Web deployment |
287
+ | LLVM Native | ~10-50x | Production |
288
+
289
+ ---
290
+
291
+ ## The Three Pillars
292
+
293
+ ShellLite v0.05.0 introduces three major features:
294
+
295
+ ```mermaid
296
+ graph TB
297
+ subgraph "The Bridge"
298
+ A[Python Libraries]
299
+ A1[pandas]
300
+ A2[requests]
301
+ A3[numpy]
302
+ A --> A1
303
+ A --> A2
304
+ A --> A3
305
+ end
306
+
307
+ subgraph "The Canvas"
308
+ B[GUI Framework]
309
+ B1[Windows]
310
+ B2[Dialogs]
311
+ B3[Controls]
312
+ B --> B1
313
+ B --> B2
314
+ B --> B3
315
+ end
316
+
317
+ subgraph "The Universe"
318
+ C[Package Manager]
319
+ C1[Dependencies]
320
+ C2[GitHub Packages]
321
+ C3[shell-lite.toml]
322
+ C --> C1
323
+ C --> C2
324
+ C --> C3
325
+ end
326
+ ```
327
+
328
+ ### The Bridge - Python Integration
329
+
330
+ Import and use any Python library directly:
331
+
332
+ ```
333
+ use "pandas" as pd
334
+ use "requests"
335
+
336
+ data = pd.read_csv("data.csv")
337
+ response = requests.get("https://api.example.com")
338
+ ```
339
+
340
+ ### The Canvas - GUI Applications
341
+
342
+ Build native desktop applications:
343
+
344
+ ```
345
+ app "My App" size 400, 300
346
+
347
+ column
348
+ heading "Welcome"
349
+ button "Click Me" on_click handle_click
350
+
351
+ to handle_click
352
+ alert "Button clicked!"
353
+ ```
354
+
355
+ ### The Universe - Package Management
356
+
357
+ ```bash
358
+ # Initialize project
359
+ shl init
360
+
361
+ # Install dependencies
362
+ shl install
363
+
364
+ # Install from GitHub
365
+ shl get username/repo
366
+ ```
367
+
368
+ **shell-lite.toml**
369
+ ```toml
370
+ [project]
371
+ name = "my-app"
372
+ version = "1.0.0"
373
+
374
+ [dependencies]
375
+ Shrey-N/shl-utils = "main"
376
+ ```
377
+
378
+ ---
379
+
380
+ ## CLI Reference
381
+
382
+ | Command | Description |
383
+ |:--------|:------------|
384
+ | `shl <file.shl>` | Run a ShellLite script |
385
+ | `shl` | Start the interactive REPL |
386
+ | `shl compile <file>` | Compile to native code (LLVM) |
387
+ | `shl compile <file> --target js` | Compile to JavaScript |
388
+ | `shl compile <file> --target python` | Compile to Python |
389
+ | `shl init` | Initialize a new project |
390
+ | `shl install` | Install project dependencies |
391
+ | `shl get <user/repo>` | Install a package from GitHub |
392
+ | `shl fmt <file>` | Format a script |
393
+ | `shl check <file>` | Lint a file (JSON output) |
394
+ | `shl help` | Show help message |
395
+
396
+ ---
397
+
398
+ ## Project Structure
399
+
400
+ ```
401
+ my-project/
402
+ ├── main.shl # Entry point
403
+ ├── shell-lite.toml # Project configuration
404
+ ├── modules/
405
+ │ ├── utils.shl # Utility functions
406
+ │ └── api.shl # API handlers
407
+ ├── tests/
408
+ │ └── test_main.shl # Test files
409
+ └── public/
410
+ └── index.html # Static files (web)
411
+ ```
412
+
413
+ ---
414
+
415
+ ## Documentation
416
+
417
+ ### Language Guide
418
+
419
+ | Chapter | Topic |
420
+ |:--------|:------|
421
+ | [01](docs/01_Getting_Started.md) | Getting Started |
422
+ | [02](docs/02_Language_Basics.md) | Language Basics |
423
+ | [03](docs/03_Control_Flow.md) | Control Flow |
424
+ | [04](docs/04_Data_Structures.md) | Data Structures |
425
+ | [05](docs/05_Functions_and_OOP.md) | Functions and OOP |
426
+ | [06](docs/06_Modules_and_StdLib.md) | Modules and Standard Library |
427
+ | [07](docs/07_System_Mastery.md) | System Mastery |
428
+ | [08](docs/08_Web_Development.md) | Web Development |
429
+
430
+ ### Advanced Topics
431
+
432
+ | Chapter | Topic |
433
+ |:--------|:------|
434
+ | [09](docs/09_Advanced_Features.md) | Advanced Features |
435
+ | [10](docs/10_Compilation_and_Performance.md) | Compilation and Performance |
436
+ | [11](docs/11_Testing_and_Debugging.md) | Testing and Debugging |
437
+ | [12](docs/12_API_Reference.md) | API Reference |
438
+
439
+ ### Guides and Resources
440
+
441
+ | Chapter | Topic |
442
+ |:--------|:------|
443
+ | [13](docs/13_Security_Guide.md) | Security Guide |
444
+ | [14](docs/14_Migration_Guide.md) | Migration Guide |
445
+ | [15](docs/15_Troubleshooting.md) | Troubleshooting |
446
+ | [16](docs/16_Examples_and_Tutorials.md) | Examples and Tutorials |
447
+ | [17](docs/17_Best_Practices.md) | Best Practices |
448
+
449
+ ---
450
+
451
+ ## Ecosystem
452
+
453
+ | Tool | Description | Link |
454
+ |:-----|:------------|:-----|
455
+ | **Book** | Language design, compiler construction, and architecture guide | [Book](https://books2read.com/b/mVpoXM) |
456
+ | **ShellDesk** | Official IDE for ShellLite | [GitHub](https://github.com/Shrey-N/ShellDesk) |
457
+ | **VS Code Extension** | Syntax highlighting and snippets | [Marketplace](https://marketplace.visualstudio.com/items?itemName=ShellLite.shelllite-hello) |
458
+ | **Research Artifact** | Published on Zenodo by CERN | [Zenodo](https://github.com/Shrey-N/ShellDesk) |
459
+
460
+ ---
461
+
462
+ ## Contributing
463
+
464
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines on how to contribute to ShellLite.
465
+
466
+ ## Security
467
+
468
+ See [SECURITY.md](SECURITY.md) for reporting security vulnerabilities.
469
+
470
+ ## License
471
+
472
+ MIT License - See [LICENSE](LICENSE) for details.
473
+
474
+ ---
475
+
476
+ **ShellLite** - Making programming accessible through natural language.
477
+
478
+ Created by Shrey Naithani