ctypes, llvm-py, and CorePy2. These are modules that let you manipulate low-level code objects in your Python
code. The ctypes module lets you build C objects in memory and call C functions in shared libraries (such as DLLs)
with those objects as parameters. The llvm-py package gives you a Python API to the LLVM, mentioned earlier, which
lets you build code and then compile it efficiently. If you wanted, you could use this to build your own compiler
(perhaps for a language of your own?) in Python. CorePy2 also lets you manipulate and efficiently run code objects,
although it works at the assembly level. (Note that ctypes is part of the Python standard library.)
Do'stlaringiz bilan baham: |