zexus 1.7.2 → 1.8.1

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 (49) hide show
  1. package/README.md +57 -6
  2. package/package.json +2 -1
  3. package/rust_core/Cargo.lock +603 -0
  4. package/rust_core/Cargo.toml +26 -0
  5. package/rust_core/README.md +15 -0
  6. package/rust_core/pyproject.toml +25 -0
  7. package/rust_core/src/binary_bytecode.rs +543 -0
  8. package/rust_core/src/contract_vm.rs +643 -0
  9. package/rust_core/src/executor.rs +847 -0
  10. package/rust_core/src/hasher.rs +90 -0
  11. package/rust_core/src/lib.rs +71 -0
  12. package/rust_core/src/merkle.rs +128 -0
  13. package/rust_core/src/rust_vm.rs +2313 -0
  14. package/rust_core/src/signature.rs +79 -0
  15. package/rust_core/src/state_adapter.rs +281 -0
  16. package/rust_core/src/validator.rs +116 -0
  17. package/scripts/postinstall.js +34 -2
  18. package/src/zexus/__init__.py +1 -1
  19. package/src/zexus/blockchain/accelerator.py +27 -0
  20. package/src/zexus/blockchain/contract_vm.py +409 -3
  21. package/src/zexus/blockchain/rust_bridge.py +64 -0
  22. package/src/zexus/cli/main.py +1 -1
  23. package/src/zexus/cli/zpm.py +1 -1
  24. package/src/zexus/evaluator/bytecode_compiler.py +150 -52
  25. package/src/zexus/evaluator/core.py +151 -809
  26. package/src/zexus/evaluator/expressions.py +27 -22
  27. package/src/zexus/evaluator/functions.py +171 -126
  28. package/src/zexus/evaluator/statements.py +55 -112
  29. package/src/zexus/module_cache.py +20 -9
  30. package/src/zexus/object.py +330 -38
  31. package/src/zexus/parser/parser.py +69 -14
  32. package/src/zexus/parser/strategy_context.py +228 -5
  33. package/src/zexus/parser/strategy_structural.py +2 -2
  34. package/src/zexus/persistence.py +46 -17
  35. package/src/zexus/security.py +140 -234
  36. package/src/zexus/type_checker.py +44 -5
  37. package/src/zexus/vm/binary_bytecode.py +7 -3
  38. package/src/zexus/vm/bytecode.py +6 -0
  39. package/src/zexus/vm/cache.py +24 -46
  40. package/src/zexus/vm/compiler.py +80 -20
  41. package/src/zexus/vm/fastops.c +1093 -2975
  42. package/src/zexus/vm/gas_metering.py +2 -2
  43. package/src/zexus/vm/memory_pool.py +21 -9
  44. package/src/zexus/vm/vm.py +527 -67
  45. package/src/zexus/zpm/package_manager.py +1 -1
  46. package/src/zexus.egg-info/PKG-INFO +79 -12
  47. package/src/zexus.egg-info/SOURCES.txt +23 -1
  48. package/src/zexus.egg-info/requires.txt +26 -0
  49. package/src/zexus.egg-info/entry_points.txt +0 -4
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  <div align="center">
4
4
 
5
- ![Zexus Logo](https://img.shields.io/badge/Zexus-v1.7.2-FF6B35?style=for-the-badge)
5
+ ![Zexus Logo](https://img.shields.io/badge/Zexus-v1.8.1-FF6B35?style=for-the-badge)
6
6
  [![License](https://img.shields.io/badge/License-MIT-blue.svg?style=for-the-badge)](LICENSE)
7
7
  [![Python](https://img.shields.io/badge/Python-3.8+-3776AB?style=for-the-badge&logo=python)](https://python.org)
8
8
  [![GitHub](https://img.shields.io/badge/GitHub-Zaidux/zexus--interpreter-181717?style=for-the-badge&logo=github)](https://github.com/Zaidux/zexus-interpreter)
@@ -67,9 +67,9 @@ Zexus is a next-generation, general-purpose programming language designed for se
67
67
 
68
68
  ---
69
69
 
70
- ## 🎉 What's New in v1.7.2
70
+ ## 🎉 What's New in v1.8.1
71
71
 
72
- ### Latest Features (v1.7.2)
72
+ ### Latest Features (v1.8.1)
73
73
 
74
74
  ✅ **FIND Keyword** - Declarative project search that resolves exact module paths with scope filtering and smart suggestions
75
75
  ✅ **LOAD Keyword & Manager** - Provider-aware configuration loader with built-in ENV, JSON, and YAML support plus caching
@@ -588,6 +588,22 @@ verify balance >= amount {
588
588
  pip install zexus
589
589
  ```
590
590
 
591
+ ### Full Install (Blockchain + Networking + Security Helpers)
592
+
593
+ ```bash
594
+ pip install "zexus[full]"
595
+ ```
596
+
597
+ ### Install Matrix
598
+
599
+ | Goal | Command | Notes |
600
+ |---|---|---|
601
+ | Minimal (interpreter + CLI) | `pip install zexus` | Pure-Python install. |
602
+ | Full runtime features | `pip install "zexus[full]"` | Installs optional deps for blockchain/network/security helpers. |
603
+ | From source | `./install.sh` | Installs `.[full]` and attempts Rust VM build when `cargo` exists. |
604
+ | Optional Rust VM (`zexus_core`) | `pip install maturin && maturin develop -m rust_core/Cargo.toml --release` | Requires Rust toolchain; otherwise Zexus falls back automatically. |
605
+ | Node/npm distribution | `npm i zexus` | Runs `pip install --user "zexus[full]"` and best-effort builds `zexus_core` if Rust is available. |
606
+
591
607
  **Includes:**
592
608
  - `zx` - Main Zexus CLI
593
609
  - `zpm` - Zexus Package Manager
@@ -597,14 +613,26 @@ pip install zexus
597
613
  ```bash
598
614
  git clone https://github.com/Zaidux/zexus-interpreter.git
599
615
  cd zexus-interpreter
600
- pip install -e .
616
+ ./install.sh
617
+
618
+ # Or, directly via pip:
619
+ pip install -e ".[full]"
620
+ ```
621
+
622
+ ### Optional: Enable Rust VM (`zexus_core`)
623
+
624
+ If you have a Rust toolchain installed (`cargo` on PATH), you can build the Rust VM extension from source:
625
+
626
+ ```bash
627
+ pip install maturin
628
+ maturin develop -m rust_core/Cargo.toml --release
601
629
  ```
602
630
 
603
631
  ### Verify Installation
604
632
 
605
633
  ```bash
606
- zx --version # Should show: Zexus v1.6.3
607
- zpm --version # Should show: ZPM v1.6.3
634
+ zx --version
635
+ zpm --version
608
636
  ```
609
637
 
610
638
  ---
@@ -2592,6 +2620,29 @@ See [Ecosystem Strategy](docs/ECOSYSTEM_STRATEGY.md) for detailed roadmap.
2592
2620
  - Consider using `native` keyword for C/C++ FFI
2593
2621
  - Profile with `memory_stats()` to check for leaks
2594
2622
 
2623
+ #### PyPI upload fails on Termux with: "unsupported platform tag 'linux_aarch64'"
2624
+ - PyPI rejects wheels with generic `linux_*` platform tags (common when building on Termux).
2625
+ - **Fix**: upload an sdist (source distribution) and/or a pure-Python wheel:
2626
+ - `python -m pip install --upgrade build twine`
2627
+ - `python -m build` # creates `dist/*.tar.gz` and (by default) a `py3-none-any.whl`
2628
+ - `python -m twine upload dist/*.tar.gz dist/*-py3-none-any.whl`
2629
+ - `ZEXUS_BUILD_EXTENSIONS=1 python -m build` means: **build the optional native extensions** (Cython/C/C++) *in addition* to the Python code (it does not skip Python). This produces a **platform-specific** wheel.
2630
+ - If you want “everything compiled” locally, use:
2631
+ - `ZEXUS_BUILD_EXTENSIONS=1 python -m build`
2632
+ - or `ZEXUS_BUILD_EXTENSIONS=1 python -m pip install .`
2633
+ - For publishing native wheels to PyPI, build them in a manylinux environment (e.g. GitHub Actions + cibuildwheel). Wheels built on Termux are usually **not** PyPI-uploadable.
2634
+ - This repo includes a workflow you can run: `.github/workflows/wheels.yml` (builds manylinux `aarch64` + `x86_64`, plus macOS/Windows wheels).
2635
+ - To publish from GitHub Actions without API tokens, use **PyPI Trusted Publishing**:
2636
+ - PyPI → your project → **Settings** → **Publishing** → **Trusted publishers** → **Add a new trusted publisher**
2637
+ - Provider: **GitHub Actions**
2638
+ - Owner: `Zaidux` (or your GitHub org/user)
2639
+ - Repository: `zexus-interpreter`
2640
+ - Workflow: `.github/workflows/wheels.yml`
2641
+ - Environment: `pypi` (and optionally also add another trusted publisher entry for `testpypi`)
2642
+ - Then either:
2643
+ - Run **Actions → “Build wheels (cibuildwheel)” → Run workflow** and choose `testpypi` first, or
2644
+ - Push a release tag like `v1.7.3` to auto-build + publish
2645
+
2595
2646
  #### Blockchain/Contract issues
2596
2647
  - Remember `TX` is a global context object (uppercase)
2597
2648
  - Use `persistent storage` for contract state
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zexus",
3
- "version": "1.7.2",
3
+ "version": "1.8.1",
4
4
  "description": "A modern, security-first programming language with blockchain support",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -52,6 +52,7 @@
52
52
  "files": [
53
53
  "bin/",
54
54
  "src/",
55
+ "rust_core/",
55
56
  "zexus.json",
56
57
  "shared_config.json",
57
58
  "README.md",