C++的Python JIT编译器

2024-10-06 12:38:20 发布

您现在位置:Python中文网/ 问答频道 /正文

目前我正在使用distutils构建和ctypes进行接口,但是我碰到了这个,这看起来很不错

import ROOT 

cppFunctionCode = '''
void f() {
std::cout << "Hi jitted C. world!" « std::endl; 
}'''

ROOT.gInterpreter.Declare(cppFunctionCode) 
ROOT.f() # Hello! 

https://root.cern.ch/code-snippet/interpreted-cpp-python

问题是根是一个非常大的框架,如果有一个工具只做C++ JIT而不是其他的工具,那就太好了。在

有没有人知道像Python这样的C++ JIT有一个简单的库吗?在

谢谢


Tags: 工具importworldroothictypesjitstd