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.
- package/README.md +57 -6
- package/package.json +2 -1
- package/rust_core/Cargo.lock +603 -0
- package/rust_core/Cargo.toml +26 -0
- package/rust_core/README.md +15 -0
- package/rust_core/pyproject.toml +25 -0
- package/rust_core/src/binary_bytecode.rs +543 -0
- package/rust_core/src/contract_vm.rs +643 -0
- package/rust_core/src/executor.rs +847 -0
- package/rust_core/src/hasher.rs +90 -0
- package/rust_core/src/lib.rs +71 -0
- package/rust_core/src/merkle.rs +128 -0
- package/rust_core/src/rust_vm.rs +2313 -0
- package/rust_core/src/signature.rs +79 -0
- package/rust_core/src/state_adapter.rs +281 -0
- package/rust_core/src/validator.rs +116 -0
- package/scripts/postinstall.js +34 -2
- package/src/zexus/__init__.py +1 -1
- package/src/zexus/blockchain/accelerator.py +27 -0
- package/src/zexus/blockchain/contract_vm.py +409 -3
- package/src/zexus/blockchain/rust_bridge.py +64 -0
- package/src/zexus/cli/main.py +1 -1
- package/src/zexus/cli/zpm.py +1 -1
- package/src/zexus/evaluator/bytecode_compiler.py +150 -52
- package/src/zexus/evaluator/core.py +151 -809
- package/src/zexus/evaluator/expressions.py +27 -22
- package/src/zexus/evaluator/functions.py +171 -126
- package/src/zexus/evaluator/statements.py +55 -112
- package/src/zexus/module_cache.py +20 -9
- package/src/zexus/object.py +330 -38
- package/src/zexus/parser/parser.py +69 -14
- package/src/zexus/parser/strategy_context.py +228 -5
- package/src/zexus/parser/strategy_structural.py +2 -2
- package/src/zexus/persistence.py +46 -17
- package/src/zexus/security.py +140 -234
- package/src/zexus/type_checker.py +44 -5
- package/src/zexus/vm/binary_bytecode.py +7 -3
- package/src/zexus/vm/bytecode.py +6 -0
- package/src/zexus/vm/cache.py +24 -46
- package/src/zexus/vm/compiler.py +80 -20
- package/src/zexus/vm/fastops.c +1093 -2975
- package/src/zexus/vm/gas_metering.py +2 -2
- package/src/zexus/vm/memory_pool.py +21 -9
- package/src/zexus/vm/vm.py +527 -67
- package/src/zexus/zpm/package_manager.py +1 -1
- package/src/zexus.egg-info/PKG-INFO +79 -12
- package/src/zexus.egg-info/SOURCES.txt +23 -1
- package/src/zexus.egg-info/requires.txt +26 -0
- 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
|
-

|
|
6
6
|
[](LICENSE)
|
|
7
7
|
[](https://python.org)
|
|
8
8
|
[](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.
|
|
70
|
+
## 🎉 What's New in v1.8.1
|
|
71
71
|
|
|
72
|
-
### Latest Features (v1.
|
|
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
|
-
|
|
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
|
|
607
|
-
zpm --version
|
|
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.
|
|
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",
|