A lightweight assembly experimentation framework for Python
Project description
Pyliu
Pyliu is a lightweight Python assembly experimentation framework for building, compiling, and executing simple assembly-like programs. It combines a small CPU instruction DSL, a compiler layer, and multiple runtime backends so you can explore low-level execution patterns from Python.
Features
- A simple CPU instruction abstraction layer
- A compiler pipeline for assembling programs into machine code
- An in-process JIT-style runtime
- A bare-metal QEMU runtime for isolated execution
- An optional CLI for installing QEMU explicitly
Installation
Install from the project directory:
pip install -e .
Or, if you are using the local virtual environment:
.venv\Scripts\python.exe -m pip install -e .
Optional QEMU dependency
QEMU is treated as an optional dependency for Pyliu.
By default, Pyliu does not try to download or install anything automatically. If you want to use the QEMU-backed runtime, install it explicitly:
python -m Pyliu install-qemu
Or, if you are using the project virtual environment:
.venv\Scripts\python.exe -m Pyliu install-qemu
Quick start
from Pyliu.verification import Program
program = Program()
program.begin()
program.mov("eax", "1")
program.ret()
program.end()
print(program.compile())
Using the QEMU runtime
from Pyliu.verification import Program, QEMURuntime
program = Program()
program.begin()
program.mov("eax", "1")
program.ret()
program.end()
runtime = QEMURuntime(timeout=5)
print(runtime.run(program))
CLI
Pyliu exposes a small CLI for optional QEMU installation:
python -m Pyliu --help
python -m Pyliu install-qemu
Project structure
Pyliu/
├── __init__.py
├── __main__.py
├── verification.py
└── tests/
└── test_qemu_optional.py
Notes
- The QEMU runtime is intended for experimentation and research-oriented workflows.
- The package is designed to remain safe and non-invasive for PyPI-style packaging by avoiding automatic system modifications during import or normal runtime use.
License
This project is provided as-is for educational and research use.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyliu-0.1.0.tar.gz.
File metadata
- Download URL: pyliu-0.1.0.tar.gz
- Upload date:
- Size: 12.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
43432baaf6acf57467c00977c1336008ddee1f70c68674209b3bd8326d1f5633
|
|
| MD5 |
70a72b526e28dbd6d3d5ba39500030a0
|
|
| BLAKE2b-256 |
7b90d0926da8d067c124b39eb5f38ffa3e296ad1bac215247924159c1a65f27f
|
File details
Details for the file pyliu-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pyliu-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5fb571aee879e7eb8d5eb22365b0ed386024d8d586330d1a880fd85a312208fa
|
|
| MD5 |
79b6ce52d206d42e8a065451af1407f5
|
|
| BLAKE2b-256 |
5b70f8083b230f5166fa9b17e689a459ade12b24292dc5fd1adedb7d14ce1925
|