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
@@ -23,7 +23,7 @@ class PackageManager:
23
23
  self.installer = PackageInstaller(self.zpm_dir)
24
24
  self.publisher = PackagePublisher(self.registry)
25
25
 
26
- def init(self, name: str = None, version: str = "1.7.2") -> Dict:
26
+ def init(self, name: str = None, version: str = "1.8.1") -> Dict:
27
27
  """Initialize a new Zexus project with package.json"""
28
28
  if self.config_file.exists():
29
29
  print(f"⚠️ {self.config_file} already exists")
@@ -1,17 +1,12 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: zexus
3
- Version: 1.7.2
3
+ Version: 1.8.1
4
4
  Summary: A modern, security-first programming language with blockchain support
5
5
  Home-page: https://github.com/Zaidux/zexus-interpreter
6
6
  Author: Zaidux
7
7
  Author-email: Zaidux <zaiduabubakar777@gmail.com>
8
8
  Maintainer-email: Zaidux <zaiduabubakar888@gmail.com>
9
9
  License: MIT
10
- Project-URL: Homepage, https://github.com/Zaidux/zexus-interpreter
11
- Project-URL: Documentation, https://github.com/Zaidux/zexus-interpreter/blob/main/docs/
12
- Project-URL: Repository, https://github.com/Zaidux/zexus-interpreter
13
- Project-URL: Issues, https://github.com/Zaidux/zexus-interpreter/issues
14
- Project-URL: Changelog, https://github.com/Zaidux/zexus-interpreter/blob/main/CHANGELOG.md
15
10
  Keywords: programming-language,interpreter,compiler,blockchain,smart-contracts,security,policy-as-code
16
11
  Classifier: Development Status :: 5 - Production/Stable
17
12
  Classifier: Intended Audience :: Developers
@@ -32,6 +27,7 @@ License-File: LICENSE
32
27
  Requires-Dist: click>=8.0
33
28
  Requires-Dist: rich>=10.0
34
29
  Requires-Dist: pygls>=1.0.0
30
+ Requires-Dist: pygments>=2.0
35
31
  Provides-Extra: dev
36
32
  Requires-Dist: pytest>=6.0; extra == "dev"
37
33
  Requires-Dist: pytest-cov>=2.0; extra == "dev"
@@ -44,6 +40,26 @@ Requires-Dist: eth-account>=0.5; extra == "blockchain"
44
40
  Provides-Extra: jit
45
41
  Requires-Dist: llvmlite>=0.41.0; extra == "jit"
46
42
  Requires-Dist: Cython>=0.29; extra == "jit"
43
+ Provides-Extra: lsp
44
+ Requires-Dist: pygls>=1.0.0; extra == "lsp"
45
+ Provides-Extra: network
46
+ Requires-Dist: websockets>=12.0; extra == "network"
47
+ Requires-Dist: aiohttp>=3.9; extra == "network"
48
+ Requires-Dist: httpx>=0.27; extra == "network"
49
+ Provides-Extra: security
50
+ Requires-Dist: bcrypt>=4.0; extra == "security"
51
+ Requires-Dist: psutil>=5.9; extra == "security"
52
+ Provides-Extra: rust
53
+ Requires-Dist: maturin>=1.5; extra == "rust"
54
+ Provides-Extra: full
55
+ Requires-Dist: web3>=5.0; extra == "full"
56
+ Requires-Dist: eth-account>=0.5; extra == "full"
57
+ Requires-Dist: websockets>=12.0; extra == "full"
58
+ Requires-Dist: aiohttp>=3.9; extra == "full"
59
+ Requires-Dist: httpx>=0.27; extra == "full"
60
+ Requires-Dist: bcrypt>=4.0; extra == "full"
61
+ Requires-Dist: psutil>=5.9; extra == "full"
62
+ Requires-Dist: maturin>=1.5; extra == "full"
47
63
  Dynamic: author
48
64
  Dynamic: home-page
49
65
  Dynamic: license-file
@@ -53,7 +69,7 @@ Dynamic: requires-python
53
69
 
54
70
  <div align="center">
55
71
 
56
- ![Zexus Logo](https://img.shields.io/badge/Zexus-v1.7.2-FF6B35?style=for-the-badge)
72
+ ![Zexus Logo](https://img.shields.io/badge/Zexus-v1.8.1-FF6B35?style=for-the-badge)
57
73
  [![License](https://img.shields.io/badge/License-MIT-blue.svg?style=for-the-badge)](LICENSE)
58
74
  [![Python](https://img.shields.io/badge/Python-3.8+-3776AB?style=for-the-badge&logo=python)](https://python.org)
59
75
  [![GitHub](https://img.shields.io/badge/GitHub-Zaidux/zexus--interpreter-181717?style=for-the-badge&logo=github)](https://github.com/Zaidux/zexus-interpreter)
@@ -118,9 +134,9 @@ Zexus is a next-generation, general-purpose programming language designed for se
118
134
 
119
135
  ---
120
136
 
121
- ## 🎉 What's New in v1.7.2
137
+ ## 🎉 What's New in v1.8.1
122
138
 
123
- ### Latest Features (v1.7.2)
139
+ ### Latest Features (v1.8.1)
124
140
 
125
141
  ✅ **FIND Keyword** - Declarative project search that resolves exact module paths with scope filtering and smart suggestions
126
142
  ✅ **LOAD Keyword & Manager** - Provider-aware configuration loader with built-in ENV, JSON, and YAML support plus caching
@@ -639,6 +655,22 @@ verify balance >= amount {
639
655
  pip install zexus
640
656
  ```
641
657
 
658
+ ### Full Install (Blockchain + Networking + Security Helpers)
659
+
660
+ ```bash
661
+ pip install "zexus[full]"
662
+ ```
663
+
664
+ ### Install Matrix
665
+
666
+ | Goal | Command | Notes |
667
+ |---|---|---|
668
+ | Minimal (interpreter + CLI) | `pip install zexus` | Pure-Python install. |
669
+ | Full runtime features | `pip install "zexus[full]"` | Installs optional deps for blockchain/network/security helpers. |
670
+ | From source | `./install.sh` | Installs `.[full]` and attempts Rust VM build when `cargo` exists. |
671
+ | Optional Rust VM (`zexus_core`) | `pip install maturin && maturin develop -m rust_core/Cargo.toml --release` | Requires Rust toolchain; otherwise Zexus falls back automatically. |
672
+ | Node/npm distribution | `npm i zexus` | Runs `pip install --user "zexus[full]"` and best-effort builds `zexus_core` if Rust is available. |
673
+
642
674
  **Includes:**
643
675
  - `zx` - Main Zexus CLI
644
676
  - `zpm` - Zexus Package Manager
@@ -648,14 +680,26 @@ pip install zexus
648
680
  ```bash
649
681
  git clone https://github.com/Zaidux/zexus-interpreter.git
650
682
  cd zexus-interpreter
651
- pip install -e .
683
+ ./install.sh
684
+
685
+ # Or, directly via pip:
686
+ pip install -e ".[full]"
687
+ ```
688
+
689
+ ### Optional: Enable Rust VM (`zexus_core`)
690
+
691
+ If you have a Rust toolchain installed (`cargo` on PATH), you can build the Rust VM extension from source:
692
+
693
+ ```bash
694
+ pip install maturin
695
+ maturin develop -m rust_core/Cargo.toml --release
652
696
  ```
653
697
 
654
698
  ### Verify Installation
655
699
 
656
700
  ```bash
657
- zx --version # Should show: Zexus v1.6.3
658
- zpm --version # Should show: ZPM v1.6.3
701
+ zx --version
702
+ zpm --version
659
703
  ```
660
704
 
661
705
  ---
@@ -2643,6 +2687,29 @@ See [Ecosystem Strategy](docs/ECOSYSTEM_STRATEGY.md) for detailed roadmap.
2643
2687
  - Consider using `native` keyword for C/C++ FFI
2644
2688
  - Profile with `memory_stats()` to check for leaks
2645
2689
 
2690
+ #### PyPI upload fails on Termux with: "unsupported platform tag 'linux_aarch64'"
2691
+ - PyPI rejects wheels with generic `linux_*` platform tags (common when building on Termux).
2692
+ - **Fix**: upload an sdist (source distribution) and/or a pure-Python wheel:
2693
+ - `python -m pip install --upgrade build twine`
2694
+ - `python -m build` # creates `dist/*.tar.gz` and (by default) a `py3-none-any.whl`
2695
+ - `python -m twine upload dist/*.tar.gz dist/*-py3-none-any.whl`
2696
+ - `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.
2697
+ - If you want “everything compiled” locally, use:
2698
+ - `ZEXUS_BUILD_EXTENSIONS=1 python -m build`
2699
+ - or `ZEXUS_BUILD_EXTENSIONS=1 python -m pip install .`
2700
+ - 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.
2701
+ - This repo includes a workflow you can run: `.github/workflows/wheels.yml` (builds manylinux `aarch64` + `x86_64`, plus macOS/Windows wheels).
2702
+ - To publish from GitHub Actions without API tokens, use **PyPI Trusted Publishing**:
2703
+ - PyPI → your project → **Settings** → **Publishing** → **Trusted publishers** → **Add a new trusted publisher**
2704
+ - Provider: **GitHub Actions**
2705
+ - Owner: `Zaidux` (or your GitHub org/user)
2706
+ - Repository: `zexus-interpreter`
2707
+ - Workflow: `.github/workflows/wheels.yml`
2708
+ - Environment: `pypi` (and optionally also add another trusted publisher entry for `testpypi`)
2709
+ - Then either:
2710
+ - Run **Actions → “Build wheels (cibuildwheel)” → Run workflow** and choose `testpypi` first, or
2711
+ - Push a release tag like `v1.7.3` to auto-build + publish
2712
+
2646
2713
  #### Blockchain/Contract issues
2647
2714
  - Remember `TX` is a global context object (uppercase)
2648
2715
  - Use `persistent storage` for contract state
@@ -24,10 +24,18 @@ SYSTEM_ANALYSIS_FINDINGS.md
24
24
  UNIFIED_SYSTEM_COMPLETE.md
25
25
  VM_DEEP_DIVE_TRACKING.md
26
26
  VM_KEYWORD_SUPPORT_REPORT.md
27
+ VULNERABILITIES_FIXES.md
27
28
  VULNERABILITY_FINDINGS.md
28
29
  VULNERABILITY_TEST_RESULTS.md
29
30
  ZEXUS_BLOCKCHAIN_REFERENCE.md
30
31
  any.zx
32
+ bench_compare.py
33
+ bench_gas_stress.py
34
+ bench_phase3.py
35
+ bench_phase6.py
36
+ bench_quick.py
37
+ bench_vs.py
38
+ benchmark_rust_vm.py
31
39
  check_action_tokens.py
32
40
  check_tokens.py
33
41
  check_verify_ast.py
@@ -73,6 +81,7 @@ zx-dev
73
81
  zx-run
74
82
  zx.bin
75
83
  .github/linguist.yml
84
+ .github/workflows/wheels.yml
76
85
  .vscode/extensions.json
77
86
  .vscode/settings.json
78
87
  .vscode/extensions/zexus-language/README.md
@@ -264,6 +273,7 @@ docs/PERFORMANCE_FEATURES.md
264
273
  docs/PHILOSOPHY.md
265
274
  docs/PLUGIN_QUICK_REFERENCE.md
266
275
  docs/PLUGIN_SYSTEM.md
276
+ docs/PYPI_TRUSTED_PUBLISHING.md
267
277
  docs/QUICK_REFERENCE.md
268
278
  docs/QUICK_START.md
269
279
  docs/README.md
@@ -465,6 +475,7 @@ issues/ISSUE3.md
465
475
  issues/ISSUE4.md
466
476
  issues/ISSUE5.md
467
477
  issues/ISSUE6.md
478
+ issues/ISSUE7.md
468
479
  issues/ISSUSE1.md
469
480
  issues/tests/test_issue5.zx
470
481
  linguist-submission/SUBMISSION_INSTRUCTIONS.md
@@ -476,12 +487,17 @@ linguist-submission/samples/blockchain.zx
476
487
  linguist-submission/samples/security.zx
477
488
  rust_core/Cargo.lock
478
489
  rust_core/Cargo.toml
490
+ rust_core/README.md
491
+ rust_core/pyproject.toml
479
492
  rust_core/src/binary_bytecode.rs
493
+ rust_core/src/contract_vm.rs
480
494
  rust_core/src/executor.rs
481
495
  rust_core/src/hasher.rs
482
496
  rust_core/src/lib.rs
483
497
  rust_core/src/merkle.rs
498
+ rust_core/src/rust_vm.rs
484
499
  rust_core/src/signature.rs
500
+ rust_core/src/state_adapter.rs
485
501
  rust_core/src/validator.rs
486
502
  samples/basic.zx
487
503
  samples/blockchain.zx
@@ -567,7 +583,6 @@ src/zexus/zexus_token.py
567
583
  src/zexus.egg-info/PKG-INFO
568
584
  src/zexus.egg-info/SOURCES.txt
569
585
  src/zexus.egg-info/dependency_links.txt
570
- src/zexus.egg-info/entry_points.txt
571
586
  src/zexus.egg-info/not-zip-safe
572
587
  src/zexus.egg-info/requires.txt
573
588
  src/zexus.egg-info/top_level.txt
@@ -789,8 +804,10 @@ tests/fixtures/print_one.zx
789
804
  tests/fixtures/use_import.zx
790
805
  tests/fixtures/use_only.zx
791
806
  tests/fixtures/modules/a.zx
807
+ tests/fixtures/modules/a.zxc
792
808
  tests/fixtures/modules/b.zx
793
809
  tests/fixtures/modules/mathmod.zx
810
+ tests/fixtures/modules/mathmod.zxc
794
811
  tests/golden/README.md
795
812
  tests/golden/function_calls_after_let.zx
796
813
  tests/golden/mixed_statement_boundaries.zx
@@ -1088,9 +1105,14 @@ tests/vm/test_memory_pool.py
1088
1105
  tests/vm/test_optimizer.py
1089
1106
  tests/vm/test_parallel_vm.py
1090
1107
  tests/vm/test_peephole_optimizer.py
1108
+ tests/vm/test_phase3_adaptive.py
1109
+ tests/vm/test_phase4_contract_vm.py
1110
+ tests/vm/test_phase5_gil_free.py
1111
+ tests/vm/test_phase6_builtins.py
1091
1112
  tests/vm/test_profiler.py
1092
1113
  tests/vm/test_register_allocator.py
1093
1114
  tests/vm/test_register_vm.py
1115
+ tests/vm/test_rust_vm.py
1094
1116
  tests/vm/test_ssa_converter.py
1095
1117
  tests/vm/test_vm_async_integration.py
1096
1118
  tests/vm/test_vm_memory_pool_integration.py
@@ -1,6 +1,7 @@
1
1
  click>=8.0
2
2
  rich>=10.0
3
3
  pygls>=1.0.0
4
+ pygments>=2.0
4
5
 
5
6
  [blockchain]
6
7
  web3>=5.0
@@ -13,6 +14,31 @@ black>=21.0
13
14
  flake8>=3.9
14
15
  mypy>=0.900
15
16
 
17
+ [full]
18
+ web3>=5.0
19
+ eth-account>=0.5
20
+ websockets>=12.0
21
+ aiohttp>=3.9
22
+ httpx>=0.27
23
+ bcrypt>=4.0
24
+ psutil>=5.9
25
+ maturin>=1.5
26
+
16
27
  [jit]
17
28
  llvmlite>=0.41.0
18
29
  Cython>=0.29
30
+
31
+ [lsp]
32
+ pygls>=1.0.0
33
+
34
+ [network]
35
+ websockets>=12.0
36
+ aiohttp>=3.9
37
+ httpx>=0.27
38
+
39
+ [rust]
40
+ maturin>=1.5
41
+
42
+ [security]
43
+ bcrypt>=4.0
44
+ psutil>=5.9
@@ -1,4 +0,0 @@
1
- [console_scripts]
2
- zexus = zexus.cli.main:cli
3
- zx = zexus.cli.main:cli
4
- zx-pypy = zexus.cli.main:cli