Replies: 1 comment
-
Hi @xelatihy, sorry about the late response, I missed this when you posted it initially. The general challenge is that you can't load the same extension module multiple times. You also can't unload and reload a binary extension module (which is something that is possible for pure Python code). That doesn't need to be where it ends, and others have found workarounds. For example, check out https://github.com/aldanor/ipybind This is a jupyter notebook extension that on-the-fly compiles C++ extension modules via pybind11 that are imported into the Python process. The trick is just to give them some random name that changes every time. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am exploring the idea of writing a very simple jit for teaching purposes.
The idea is to compile a python function to C++ code, compile that code
on the fly with a C++ compiler, and load the dll/so back interactively.
nanobind would serve to generate interface code.
This would work similarly to Nvidia's warp library.
I wonder whether there are examples of this use or reason for this not
to work up front.
Beta Was this translation helpful? Give feedback.
All reactions