The way I'd do this is <https://github.com/timotheecour/Nim/issues/598> which 
would allow user code to be registered as vmops, which run natively:
    
    
    proc fn(a: int): int {.vmhook.} =
      # this will be compiled as machine code
      # and run like a vmops
      ...
    
    
    Run

the 2nd ingredient is cling, which allows incremental C/C++ compilation based 
on clang (refs <https://github.com/timotheecour/Nim/issues/705>) which provides 
fast compile times (suitable for JIT) and high performance code generation 
(close to what you'd get from compiling via clang directly)

Reply via email to