tumorscript 0.1.1__tar.gz → 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 (24) hide show
  1. {tumorscript-0.1.1 → tumorscript-1.0.0}/PKG-INFO +132 -13
  2. tumorscript-0.1.1/tumorscript.egg-info/PKG-INFO → tumorscript-1.0.0/README.md +534 -434
  3. {tumorscript-0.1.1 → tumorscript-1.0.0}/pyproject.toml +1 -1
  4. {tumorscript-0.1.1 → tumorscript-1.0.0}/tumorscript/__init__.py +1 -1
  5. tumorscript-1.0.0/tumorscript/bin/tumorscript.exe +0 -0
  6. tumorscript-1.0.0/tumorscript/main.lua +90 -0
  7. tumorscript-1.0.0/tumorscript/src/capsid.lua +389 -0
  8. tumorscript-1.0.0/tumorscript/src/interpreter.lua +1413 -0
  9. tumorscript-1.0.0/tumorscript/src/json.lua +562 -0
  10. {tumorscript-0.1.1 → tumorscript-1.0.0}/tumorscript/src/lexer.lua +24 -8
  11. {tumorscript-0.1.1 → tumorscript-1.0.0}/tumorscript/src/memory.lua +112 -12
  12. {tumorscript-0.1.1 → tumorscript-1.0.0}/tumorscript/src/parser.lua +136 -40
  13. tumorscript-1.0.0/tumorscript/src/repl.lua +320 -0
  14. tumorscript-0.1.1/README.md → tumorscript-1.0.0/tumorscript.egg-info/PKG-INFO +553 -415
  15. {tumorscript-0.1.1 → tumorscript-1.0.0}/tumorscript.egg-info/SOURCES.txt +4 -1
  16. tumorscript-0.1.1/tumorscript/bin/tumorscript.exe +0 -0
  17. tumorscript-0.1.1/tumorscript/main.lua +0 -62
  18. tumorscript-0.1.1/tumorscript/src/interpreter.lua +0 -526
  19. {tumorscript-0.1.1 → tumorscript-1.0.0}/LICENSE +0 -0
  20. {tumorscript-0.1.1 → tumorscript-1.0.0}/setup.cfg +0 -0
  21. {tumorscript-0.1.1 → tumorscript-1.0.0}/tumorscript/cli.py +0 -0
  22. {tumorscript-0.1.1 → tumorscript-1.0.0}/tumorscript.egg-info/dependency_links.txt +0 -0
  23. {tumorscript-0.1.1 → tumorscript-1.0.0}/tumorscript.egg-info/entry_points.txt +0 -0
  24. {tumorscript-0.1.1 → tumorscript-1.0.0}/tumorscript.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tumorscript
3
- Version: 0.1.1
3
+ Version: 1.0.0
4
4
  Summary: A biomorphic and entropic esoteric programming language runtime
5
5
  Author: TumorScript Contributors
6
6
  License-Expression: MIT
@@ -62,8 +62,8 @@ Dynamic: license-file
62
62
  <ul>
63
63
  <li><a href="#the-biological-philosophy">The Biological Philosophy</a></li>
64
64
  <li><a href="#core-biomorphic-mechanisms">Core Biomorphic Mechanics</a></li>
65
- <li><a href="#file-extension-taxonomy">File Extension Taxonomy</a></li>
66
- <li><a href="#keyword-dictionary">Keyword Dictionary</a></li>
65
+ <li><a href="#file-extension">File Extension</a></li>
66
+ <li><a href="#keyword--built-in-dictionary">Keyword & Built-in Dictionary</a></li>
67
67
  <li><a href="#built-with">Built With</a></li>
68
68
  </ul>
69
69
  </li>
@@ -79,8 +79,10 @@ Dynamic: license-file
79
79
  <li>
80
80
  <a href="#usage">Usage</a>
81
81
  <ul>
82
+ <li><a href="#interactive-cellular-shell-repl">Interactive Cellular Shell (REPL)</a></li>
82
83
  <li><a href="#clinical-case-study-hospital_coretmq">Clinical Case Study</a></li>
83
84
  <li><a href="#runtime-mutation-trace">Runtime Mutation Trace</a></li>
85
+ <li><a href="#metastasis-call-stack--autopsy-traceback">Metastasis Call Stack & Traceback</a></li>
84
86
  <li><a href="#oncology-survival-guide">Oncology Survival Guide</a></li>
85
87
  </ul>
86
88
  </li>
@@ -131,32 +133,65 @@ Every time a CPU instruction observes a piece of DNA data, $\delta$ climbs from
131
133
 
132
134
  <p align="right">(<a href="#readme-top">back to top</a>)</p>
133
135
 
134
- ### File Extension Taxonomy
136
+ ### File Extension
135
137
 
136
- TumorScript classifies source code into containment biosafety levels:
138
+ TumorScript programs use the official `.tmq` (Tumor Quarantine) file extension:
137
139
 
138
140
  | Extension | Name | Biosafety Level | Purpose |
139
141
  |---|---|---|---|
140
- | `.tmq` | Tumor Quarantine | Level 4 (Primary) | Main executable files containing quarantine chambers and program logic. |
141
- | `.tmr` | Tumor Source Module | Level 3 (Intermediate) | Importable cellular modules and secondary logic units. |
142
- | `.tmh` | Tumor Header | Level 1 (Sterile) | Mutation-proof header files containing exclusively immutable `rna` constants. |
143
- | `.tmz` | Tumor Zone | Level 5 (Extreme Hazard) | High-risk experimental zones where mutation and metastasis rates are tenfold. |
144
- | `.tmb` | Tumor Bytecode | Machine Artifact | Compiled intermediate binary bytecode for the virtual machine. |
142
+ | `.tmq` | Tumor Quarantine | Level 4 (Primary) | Official executable files containing quarantine chambers and program logic. |
145
143
 
146
144
  <p align="right">(<a href="#readme-top">back to top</a>)</p>
147
145
 
148
- ### Keyword Dictionary
146
+ ### Keyword & Built-in Dictionary
149
147
 
150
- | Standard Syntax | TumorScript Keyword | Biological Role |
148
+ | Standard Syntax | TumorScript Construct | Biological Role |
151
149
  |---|---|---|
152
150
  | `var` / `let` | `dna` | Mutable variable subject to decay on every read. |
153
151
  | `const` | `rna` | Mutation-immune constant. |
152
+ | `array` / `list` | `tumor(...)` / `[...]` | Ordered cluster of cells; reading elements mutates them. |
153
+ | `dict` / `map` | `membrane(...)` | Cell membrane receptor-ligand key-value pairs. |
154
+ | `break` | `remission` | Premature cessation of loop iteration (tumor remission). |
155
+ | `continue` | `relapse` | Skip remainder of cycle and jump to next phase (tumor relapse). |
156
+ | `for ... in` | `for cell in cluster:` | Cellular iteration over tumors, membranes, and sequences. |
157
+ | `range(start, stop)` | `range(...)` | Generates a sequential tumor growth array. |
158
+ | ⭐ *Unique* | `necrosis(N, val)` | Timed cell death; automatically decays and dies after N reads. |
159
+ | `biopsy(t, idx)` | `biopsy` | Surgical clean read of a tumor element without mutation. |
160
+ | `spread(t, val)` | `spread` | Appends a new cell to a tumor growth cluster. |
161
+ | `excise(t, idx)` | `excise` | Surgically removes and returns a cell from a tumor. |
162
+ | `len(x)` | `mass(x)` | Measures biological tumor mass, membrane receptor count, or string length. |
163
+ | `typeof(x)` | `strain(x)` | Identifies biological data strain ("tumor", "membrane", "cell", etc.). |
164
+ | `bind / unbind` | `bind / unbind` | Attaches or removes receptor ligands on a cell membrane. |
165
+ | `keys(m)` | `receptors(m)` | Extracts all bound receptor keys from a cell membrane as a tumor. |
154
166
  | `class` / `struct` | `cell` | Living cellular blueprint containing state and traits. |
155
167
  | `function` / `def` | `gene` | Cellular functional logic; degrades if fed mutated arguments. |
156
168
  | `new` / `clone` | `mitosis` | Duplicates and spawns an independent living cell instance. |
157
169
  | `return` | `apoptosis` | Programmed cell death; cleans up scope and yields data. |
158
170
  | `import` | `metastasis` | Cross-module dissemination of code and functions. |
159
171
  | `try` / `catch` | `quarantine` / `chemo` | Isolation and toxic intervention strategies. |
172
+ | **I/O** | | |
173
+ | `input(prompt?)` | `absorb(prompt?)` | Read a line from standard input (user absorption). |
174
+ | `read_file(path)` | `ingest(path)` | Ingest file contents into a string. |
175
+ | `write_file(path, data)` | `secrete(path, data)` | Secrete data into a file (overwrite). |
176
+ | `append_file(path, data)` | `infiltrate(path, data)` | Infiltrate additional data into an existing file. |
177
+ | `file_exists(path)` | `file_exists(path)` | Check if a file path exists. |
178
+ | **String & Array** | | |
179
+ | `split(str, sep?)` | `lyse(str, sep?)` | Lyse a string into a tumor array by separator. |
180
+ | `join(tumor, sep?)` | `fuse(tumor, sep?)` | Fuse tumor array elements into a single string. |
181
+ | `upper(str)` | `hypertrophy(str)` | Aggressive uppercase conversion (cellular overgrowth). |
182
+ | `lower(str)` | `atrophy(str)` | Lowercase degradation (tissue atrophy). |
183
+ | `trim(str)` | `trim(str)` | Strip leading/trailing whitespace. |
184
+ | `contains(col, val)` | `contains(col, val)` | Test if a string, tumor, or membrane contains a value. |
185
+ | `slice(col, s, e?)` | `resect(col, s, e?)` | Surgical sub-range extraction (resection). |
186
+ | **Math** | | |
187
+ | `sqrt / floor / ceil` | `sqrt / floor / ceil` | Standard math operations. |
188
+ | `round(x, d?)` | `round(x, d?)` | Round to `d` decimal places. |
189
+ | `abs / min / max / pow` | `abs / min / max / pow` | Absolute value, extrema, and exponentiation. |
190
+ | `random(...)` | `random(...)` | Pseudo-random number generation. |
191
+ | **Time** | | |
192
+ | `sleep(seconds)` | `dormancy(seconds)` | Suspend execution (cellular dormancy). |
193
+ | `time()` | `time()` | Unix epoch timestamp. |
194
+ | `clock()` | `metabolism()` | High-resolution CPU clock (metabolic rate). |
160
195
 
161
196
  <p align="right">(<a href="#readme-top">back to top</a>)</p>
162
197
 
@@ -198,7 +233,11 @@ pip install tumorscript
198
233
 
199
234
  Once installed, the `tumorscript` command is available system-wide:
200
235
  ```sh
236
+ # Execute a script
201
237
  tumorscript examples/hospital_core.tmq
238
+
239
+ # Or launch the interactive cellular shell (REPL)
240
+ tumorscript
202
241
  ```
203
242
 
204
243
  <p align="right">(<a href="#readme-top">back to top</a>)</p>
@@ -247,6 +286,44 @@ tumorscript --unregister
247
286
  <!-- usage examples -->
248
287
  ## Usage
249
288
 
289
+ ### Interactive Cellular Shell (REPL)
290
+
291
+ Running `tumorscript` with no arguments opens the real-time biomorphic REPL. You can declare variables, execute functions, and watch data drift live as it is observed:
292
+
293
+ ```text
294
+ $ tumorscript
295
+ ======================================================================
296
+ TumorScript Interactive Malignancy Shell (REPL) v1.0.0
297
+ Type expressions to evaluate or statements to execute.
298
+ Type ':help' for clinical commands, ':exit' to quit.
299
+ ======================================================================
300
+ >>> dna white_blood_cells = 4500
301
+ >>> white_blood_cells
302
+ 4518.239102
303
+ >>> white_blood_cells
304
+ 4482.019481
305
+ >>> hypertrophy("malignant growth")
306
+ "MALIGNANT GROWTH"
307
+ >>> :vitals
308
+
309
+ --- SPECIMEN VITALS (Active Heap Telemetry) ---
310
+ Specimen Strain Value Reads Mutation Status
311
+ --------------------------------------------------------------------------
312
+ white_blood_cells dna 4482.019481 2 1.10 % HEALTHY
313
+ ==========================================================================
314
+ System Malignancy: 0/1 specimens corrupted (0.0% / 50.0% failure threshold)
315
+ ```
316
+
317
+ Interactive meta-commands:
318
+ * `:vitals` - Scan active heap specimen counts, read frequencies, mutation rates, and malignancy ratios.
319
+ * `:chemo <var>` - Administer targeted chemotherapy to reset a mutated variable back to baseline.
320
+ * `:flush` - Purge the interactive heap and reset to a sterile cleanroom state.
321
+ * `:clear` - Clear console output without resetting variables.
322
+ * `:help` - Display interactive manual and syntax tips.
323
+ * `:exit` / `:quit` - Trigger programmed apoptosis and exit the shell.
324
+
325
+ <p align="right">(<a href="#readme-top">back to top</a>)</p>
326
+
250
327
  ### Clinical Case Study: `hospital_core.tmq`
251
328
 
252
329
  Below is the canonical TumorScript program simulating patient vital signs under entropic stress:
@@ -332,6 +409,43 @@ Notice that:
332
409
 
333
410
  <p align="right">(<a href="#readme-top">back to top</a>)</p>
334
411
 
412
+ ### Metastasis Call Stack & Autopsy Traceback
413
+
414
+ When systemic heap corruption crosses the **50% terminal threshold**, the virtual machine panics and generates a post-mortem diagnostic detailing Patient Zero, transmission trails, and active cellular frames:
415
+
416
+ ```text
417
+ ==============================================================================
418
+ [!] CRITICAL BIOLOGICAL CRASH: ORGAN FAILURE EXCEPTION
419
+ ==============================================================================
420
+ Malignant Saturation: 2/4 specimens corrupted (50.0% >= 50.0% fatal threshold)
421
+ Clinical Diagnostic: Cellular tissue suffered irreversible entropy collapse.
422
+
423
+ --- PATIENT ZERO (Initial Site of Malignancy) ---
424
+ Specimen Name : cycle
425
+ Malignant at Read : Read #4 (drifted to rate 2.55%)
426
+ Contagion Rate : 2.55%
427
+ Origin Location : gene 'main' at line 24
428
+
429
+ --- METASTASIS TRANSMISSION TRAIL (Contagion Vectors) ---
430
+ [1] Contagion Spread: 'cycle' (reads: 94, rate: 5.00%) infected 'cycle' at line 24
431
+ ...
432
+ [10] Malignancy Spawned: 'beta' degraded at read #67 (drift rate: 5.00%) in main:26
433
+
434
+ --- METASTASIS CALL STACK (Active Cellular Frames) ---
435
+ Frame [0] main() at examples/organ_failure_test.tmq:32 [sterile]
436
+
437
+ --- SPECIMEN BIOPSY TELEMETRY (Active Memory Heap) ---
438
+ Specimen Strain Value Reads Mutation Status
439
+ --------------------------------------------------------------------------
440
+ cycle dna 52.511859324581 135 5.00 % MALIGNANT [METASTASIZED]
441
+ beta dna 112.81541821281 67 5.00 % MALIGNANT [METASTASIZED]
442
+ gamma dna 131.38216628811 67 5.00 % HEALTHY
443
+ alpha dna 47.259377430104 67 5.00 % HEALTHY
444
+ ==============================================================================
445
+ ```
446
+
447
+ <p align="right">(<a href="#readme-top">back to top</a>)</p>
448
+
335
449
  ### Oncology Survival Guide
336
450
 
337
451
  * **Defensive RNA Anchoring:** Use `rna` for iteration limits, step offsets, and critical thresholds. `rna` cannot mutate, preventing infinite loops caused by decaying integers.
@@ -354,6 +468,11 @@ Notice that:
354
468
  - [x] Windows Registry `.tmq` double-click file association in CMD
355
469
  - [x] npm (`npm install -g tumorscript`) and pip (`pip install tumorscript`) distributions
356
470
  - [x] Comprehensive GitHub Wiki documentation suite
471
+ - [x] Standard Library: I/O (`absorb`, `ingest`, `secrete`), String (`lyse`, `fuse`, `hypertrophy`, `atrophy`), Math (`sqrt`, `round`, `pow`), Time (`dormancy`, `metabolism`)
472
+ - [x] Biomorphic Genomics & JSON Engine: `transcribe` (serialization), `express` (deserialization), `karyotype` (structural diagnostics), `transduce` (genetic splicing), file secretion/ingestion, and stochastic radiation entropy
473
+ - [x] Biomorphic Capsid Binary Engine: `condense` (pack), `decondense` (unpack), `strand_length` (calcsize), `splice_into` (pack_into), `biopsy_from` (unpack_from), `cleave` (iter_unpack), `hex_biopsy`, and Shannon entropy telemetry
474
+ - [x] Interactive Malignancy Shell (REPL) with real-time entropy observation and `:vitals` heap telemetry
475
+ - [x] Metastasis Call Stack & Autopsy Traceback on systemic organ failure
357
476
  - [ ] Radiation Therapy (`radiation`): Purges 90% of memory corruption, but mutates all other variables by 30%
358
477
  - [ ] Network Metastasis: Spreading cancer across remote machines via raw TCP/IP sockets
359
478
  - [ ] CRISPR Gene Editing: Runtime AST self-modifying code rewrite engine
@@ -419,7 +538,7 @@ Wiki Documentation: [https://github.com/yamanist0/Tumor-Script/wiki](https://git
419
538
  [issues-url]: https://github.com/yamanist0/Tumor-Script/issues
420
539
  [license-shield]: https://img.shields.io/badge/license-MIT-green.svg?style=for-the-badge
421
540
  [license-url]: https://github.com/yamanist0/Tumor-Script/blob/main/LICENSE
422
- [version-shield]: https://img.shields.io/badge/version-0.1.1-rose.svg?style=for-the-badge
541
+ [version-shield]: https://img.shields.io/badge/version-1.0.0-rose.svg?style=for-the-badge
423
542
  [version-url]: https://github.com/yamanist0/Tumor-Script/releases
424
543
  [product-screenshot]: https://raw.githubusercontent.com/yamanist0/Tumor-Script/main/icon.svg
425
544
  [Rust-badge]: https://img.shields.io/badge/Rust-000000?style=for-the-badge&logo=rust&logoColor=white