2 ms·
Afaik there was a prototype Ruby JIT that used the C compiler this way and loaded the resulting code as a shared library. I did this with a Python decorator and
by sitkack 2y ago
Afaik there was a prototype Ruby JIT that used the C compiler this way and loaded the resulting code as a shared library. I did this with a Python decorator and ctypes so I could inline and hot reload my C extensions using
@c_func
def add1(n : int) -> int:
"""
return n + 1
"""
I haven't touched this space in years, I think there are a couple Python libraries that do this now. I did not generate C code at runtime tho.
- kragen 2y agonice!