1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
[]
= "pythonrs"
= "0.1.15"
= "2021"
= "1.80"
= ["MenkeTechnologies <linux.dev25@gmail.com>"]
= "Python as a fusevm frontend: lexer, parser, and compiler to fusevm::Chunk on a PyHost heap — the first compiled standalone Python runtime"
= "MIT"
= "https://github.com/MenkeTechnologies/pythonrs"
= "https://menketechnologies.github.io/pythonrs/"
= "https://docs.rs/pythonrs"
= "README.md"
= ["python", "interpreter", "compiler", "jit", "fusevm"]
= ["command-line-utilities", "compilers"]
= true
# Dev-only artifacts kept out of the published crate. Consumers get src + the
# `python`/gen-docs/parity bins, the man page, and shell completions — not the
# HUD site, CI config, integration-test corpus, self-test .py examples, or the
# bug tracker. None are referenced at compile time (no include_str! into them),
# so the packaged crate still builds and its bins run.
# `pylib/` is NOT excluded — it is the vendored pure-Python stdlib the `python`
# bin loads at runtime.
= [
"/.github/",
"/tests/",
"/examples/",
"/docs/",
"/scripts/",
"/BUGS.md",
"/CHECKLIST.md",
"/FFI_STDLIB.md",
]
# pythonrs is a standalone crate, not a workspace member. An explicit empty
# `[workspace]` stops cargo walking up to the MenkeTechnologiesMeta parent.
[]
[]
= "pythonrs"
= "src/lib.rs"
# staticlib so an AOT object can be linked against the pythonrs runtime (the
# extension-op dispatch + the fusevm AOT runtime) into a standalone native
# executable via `python --build`.
= ["rlib", "staticlib"]
[[]]
= "python"
= "src/main.rs"
# Offline generator for docs/reference.html — renders the builtin/method
# reference (src/lsp.rs corpus) as a static page. Run before pushing Pages.
[[]]
= "gen-docs"
= "src/bin/gen_docs.rs"
# Differential parity harness: runs the corpus through pythonrs and the reference
# `python3`, diffing stdout. Development tool — needs `python3` on PATH, so CI
# never runs it. There is no frozen-output replay: this comment used to point at
# tests/data/parity_expected.txt and tests/parity.rs, neither of which exists, so
# nothing here runs without a `python3`.
[[]]
= "parity"
= "src/bin/parity.rs"
# Differential parity FUZZER: generates thousands of deterministic-output Python
# snippets (biased toward float repr, int //-/%- sign rules, bignum, slices, the
# format mini-language, string methods) and diffs `python -c` against the
# reference `python3 -c`, delta-debugging every divergence to a minimal repro.
# Subprocess-only (never links the lib); std-only (no `rand`). Dev tool — needs
# `python3` on PATH, so CI never runs it.
[[]]
= "parity-fuzz"
= "src/bin/parity_fuzz.rs"
[]
# Python executes on fusevm. pythonrs is a pure frontend: it lowers Python to
# fusevm bytecode (src/compiler.rs) and hosts the Python object heap
# (src/host.rs, reached from fusevm's extension handler). Object/str/list/dict
# cells ride through the VM as `Value::Obj(u32)` handles into that heap.
#
# `jit-disk-cache` turns on fusevm's three-tier Cranelift JIT *and* its
# persistent on-disk cache of compiled native code (keyed by chunk hash), so hot
# Python loops trace-compile and warm runs skip recompilation. `aot` enables the
# ahead-of-time object emitter behind `python --build`.
= { = "0.26.10", = ["jit", "jit-disk-cache", "aot", "ffi"] }
= { = "4.5", = ["derive", "cargo"] }
= "2.0"
= "2.1"
= "0.2"
# Python dict preserves insertion order (guaranteed since 3.7, observable in
# iteration/repr).
= "2"
# rkyv-backed bytecode cache at ~/.pythonrs/scripts.rkyv (mirrors zshrs/rubylang):
# the outer shard is a zero-copy rkyv archive; the inner per-script fusevm::Chunk
# is bincode (fusevm::Chunk is serde-owned, not rkyv::Archive). Versioned from
# day one so a cached .py that worked never breaks (compat floor).
= { = "0.7", = ["validation", "archive_le", "size_32"] }
= "1.3"
= "0.9"
= "5"
= "1"
# LSP (`python --lsp`) + DAP (`python --dap`) over stdio. libc gives the DAP
# server a pipe + dup2 to capture the debuggee's stdout (print) so program output
# streams as `output` events instead of corrupting the JSON-RPC channel.
= "0.7.9"
= "0.97.0"
= { = "1", = ["derive"] }
= "1"
= "0.2"
# Interactive REPL (`python --repl` / TTY fallthrough): reedline line editor,
# nu-ansi-term for the banner/status colors, sysinfo for the live stats box.
= "0.47.0"
= "0.50"
= { = "0.38", = false, = ["system"] }
= "0.8"
# Hash algorithms behind `hashlib`'s `_md5`/`_sha1`/`_sha2`/`_sha3`/`_blake2`.
# A hash is defined by its test vectors; these are audited implementations of the
# same FIPS/RFC specifications CPython links OpenSSL for. See `src/stdlib/pyhash.rs`.
= "0.10"
= "0.10"
= "0.10"
= "0.10"
= "0.10"
= "0.10"
# Regex engines backing the `re` module: `regex` for the linear-time majority,
# `fancy-regex` for the patterns it cannot express (look-around, backreferences)
# — `_pydecimal` and `fractions` both need lookahead. See `src/regexpr.rs`.
= "1"
= "0.18"
= "0.3"
# Stackful same-thread coroutines backing Python generators (yield) and the
# async event loop. Switches the native stack on the SAME OS thread, so the
# thread_local! PyHost object heap is shared across a generator suspend/resume.
= "0.3"
# Arbitrary-precision integers: Python `int` is unbounded, so values that fit
# stay `i64` and only the overflow path allocates a `BigInt` heap object.
= "0.4"
= "0.1"
= "0.2"
# Pure-Rust libm for the special functions Rust std lacks (`lgamma`/`gamma`/`erf`/
# `erfc`) — part of the self-contained `math` surface, no C libm dependency.
= "0.2"
# Exact rationals backing `fractions.Fraction` and complex support.
= "0.4"
= "0.4"
# CPython stdlib FFI bridge (feature `stdlib-ffi`, ON by default — see [features]).
# `import <stdlib>` delegates to an embedded libpython over pyo3 instead of a
# hand-rolled shadow — the real CPython stdlib (pure `.py` + C accelerators).
# Disable with `--no-default-features` for a pyo3-free, libpython-free build.
# `abi3-py39` links one binary against any CPython >= 3.9 via the stable ABI.
# 3.9 is the floor because it is the oldest the limited API can express what
# `src/ffi.rs` needs — `#[pyclass(dict)]` is rejected below it — not a taste for
# old CPython. A higher floor is not free: `abi3-py313` made `cargo install
# pythonrs` fail outright wherever the host CPython was older ("cannot set a
# minimum Python version 3.13 higher than the interpreter version 3.12" on
# Fedora 40), and, being pyo3 0.24's own ceiling, it also demanded
# `PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1` on 3.14 hosts. At 3.9 neither end
# fires: 3.9 through 3.14 build with no extra env.
= { = "0.29", = ["abi3-py39", "auto-initialize"], = true }
= "3.1.0"
= "1.1.0"
# PEP 3131 NFKC identifier normalization in the lexer (CPython folds every
# non-ASCII identifier with `unicodedata.normalize("NFKC", …)`).
= "0.1"
[]
# stdlib-ffi is ON by default so `import os` (and the rest of the CPython stdlib)
# works out of the box. It needs a CPython >= 3.9 at build time (pyo3 links it);
# no extra env is required at any version through 3.14. `--no-default-features`
# drops pyo3/libpython for a native-only build (only pythonrs's built-in
# modules) — that is what the release binaries ship.
= ["stdlib-ffi"]
= ["dep:pyo3"]
[]
= "3"
# For `strerror(ERANGE)`: the float-overflow message is the C library's own
# and is worded differently by Apple libc and glibc, so the test derives it
# rather than hardcoding either spelling.
= "0.2"