3 ms·
It would be interesting exercise to compile cells into object files as they are entered and load them dynamically into a persistent process, doing needed linkin
by zokier 9y ago
It would be interesting exercise to compile cells into object files as they are entered and load them dynamically into a persistent process, doing needed linking etc on the fly in-memory. You'd also need to generate a header file from the current in-memory symbol table and implicitly include that in compilation.
That might actually work relatively well for simple cases. But I imagine there would be a ton of problematic edge cases, considering that with C you can end up with all sorts of weird stuff.
- dgfgfdagasdfgfa 9y agoIf you protect it appropriately, you've basically re-implemented exec.
- williamstein 9y agoThe %cython mode for Sage notebooks (which I wrote in I think 2008??) does precisely that by generating a random-named Python shared object libary and importing it into the runnig Python process after each evaluation. There's a similar (%%cython?) mode for Jupyter notebooks.