Elide runs Python 3.13 programs with CPython’s command-line arguments, from the same binary that runs JavaScript, TypeScript, Java and Kotlin.
Python support is experimental in 1.6.0.
Run the same code
Add the optional Python component once:
elide setup pythonThen use elide python in place of python:
elide python app.py --name Elide # sys.argv: ['app.py', '--name', 'Elide']
elide python -c 'import sys; print(sys.version)'
elide python -m json.tool input.json
elide run app.py # same program, general runnerThese work unchanged:
- Scripts,
-c,-m,-(standard input), and the REPL (bareelide python). - Interpreter flags such as
-I,-E,-S,-B,-u,-Oand-W; the full list is in Python with Elide. - The Python 3.13 standard library, including
json,pathlib,sqlite3,ssl,ctypes,bz2andlzma. - Packages from an existing Python 3.13 virtual environment, through
VIRTUAL_ENV:
export VIRTUAL_ENV=/path/to/venv # Elide reads $VIRTUAL_ENV/lib/python3.13/site-packages
elide python app.pyWhat changes
| With CPython | With Elide |
|---|---|
python app.py | elide python app.py or elide run app.py |
python -c CMD, python -m MODULE | elide python -c CMD, elide python -m MODULE |
| Install CPython | elide setup python |
pip install PACKAGE | No equivalent; elide install --ecosystems= exits 2. |
python -m venv, source . | Install into a Python 3.13 venv with CPython’s pip; set VIRTUAL_ENV. |
pytest | elide python -m pytest with pytest in the venv; elide test finds no Python tests. See Python tests. |
timeout 30 python app. | elide --timeout 30s python app.; exits 124 when the limit is exceeded. |
Benchmarks
Hello-world startup with hyperfine -N -w 10 (10 warmup runs, 100 measured) on a 24-core Linux workstation:
| Command | Mean |
|---|---|
elide run hello.py | 4.8 ± 0.3 ms |
python3 hello.py | 6.0 ± 0.3 ms |
No other Python benchmark is published for 1.6.0.
Strengths
bz2andlzmawork without systemlibbz2orliblzma.- Python calls JavaScript, and JavaScript or TypeScript imports Python modules, in one process with
--interop. - The same binary runs JavaScript, TypeScript and JVM code and builds JVM projects.
Weaknesses
- No
pipand no Python test runner. - Some C extension modules do not load.
- Some edge cases differ from CPython 3.13: 93.8% of CPython core tests pass (Compatibility Matrix).
- macOS has no native module isolation.
- With Python installed, WebAssembly SIMD modules are rejected; see WebAssembly with Elide.