An example Python package written in x86-64 assembly.
Project description
# Building Python Extension Modules in Assembly
![GitHub Actions](https://github.com/tonybaloney/python-assembly-poc/workflows/Python%20package/badge.svg)
This repository is a proof-of-concept to demonstrate how you can create a Python Extension in 100% assembly.
Demonstrates:
How to write a Python module in pure assembly
How to write a function in pure assembly and call it from Python with Python objects
How to call the C API to create a PyObject and parse PyTuple (arguments) into raw pointers
How to pass data back into Python
How to register a module from assembly
How to create a method definition in assembly
How to write back to the Python stack using the dynamic module loader
How to package a NASM/Assembly Python extension with distutils
The simple proof-of-concept function takes 2 parameters,
`default >>> import pymult >>> pymult.multiply(2, 4) 8 `
## But, Why?
Just because it can be done.
Also, I want to see if some AVX/AVX2 instructions (high-performance matrix multiplication especially) can be used directly from Python.
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
Hashes for pymult-0.0.2-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7bfbb0d2a04315b583f56a2f38a2e848e6040dc4df326f6cec303b4729c89ab6 |
|
MD5 | 6da2e0d8f668a4e4a4df68c89ef3a766 |
|
BLAKE2b-256 | f4727feb256800dd75b1d0a18b7acc883220f697532cc4f9a1cac08071fc6462 |