This is a project to wrap LLVM C API using a Pycopy's
ffi module,
thus producing pure-Python bindings to a sufficiently large subset of LLVM
functionality. Pycopy is a minimalist
implementation of the Python language. Pycopy's ffi
module was also
ported to CPython,
so ullvm_c
is compatible with CPython too (or any other Python
implementation which provides ctypes
module).
Two examples are included, JIT-generating a simple function, using both older MCJIT, and newer ORC LLVM JIT engines:
pycopy example_mcjit.py
pycopy example_orcjit.py
To using with CPython, you would need to install Pycopy compatibility modules for CPython:
pip3 install -r requirements-cpython.txt
Afterwards, you can run the samples in the same way as with Pycopy:
python3 example_mcjit.py
python3 example_orcjit.py
Copyright (c) 2019 Paul Sokolovsky. Released under the terms of MIT license.