任何C / C ++到非本地字节码编译器/解释器?

时间:2022-10-13 20:45:23

As the title indicates, are there any C/C++ bytecode compilers/interpreters? I'm writing an application in an interpreted language that depends on certain libraries that are fully cross-compilable (there are no special flags to indicate code changes during compilation for a certain platform) but are written in C and C++. Rather than shipping n-platform-specific-libs with each platform, it would be nice to ship one set of libs which are interpreted by one platform specific interpreter.

正如标题所示,是否有任何C / C ++字节码编译器/解释器?我正在用一种解释语言编写应用程序,该语言依赖于某些完全可交叉编译的库(在编译某个平台时没有特殊的标志来指示代码更改)但是用C和C ++编写。不是在每个平台上运送n-platform-specific-libs,而是运送一组由一个平台特定的解释器解释的lib。

Possible and/or available?

可能和/或可用?

EDIT1: The interpreted language in question is Python, though I may also use Ruby.

EDIT1:有问题的解释语言是Python,虽然我也可以使用Ruby。

2 个解决方案

#1


3  

Which interpreted language are you using? If it has a .NET based implementation (e.g. IronPython) you could possibly use it with the C++/CLI compiler to produce byte code for the .NET CLR and Mono.

你使用哪种解释语言?如果它具有基于.NET的实现(例如IronPython),您可以将它与C ++ / CLI编译器一起使用,以生成.NET CLR和Mono的字节代码。

This is only likely to be feasible if you have full control over your C++ libraries.

如果您完全控制C ++库,这可能是可行的。

#2


1  

If you are not sure about using the .NET VM/CLR, then you could give the Java VM a try with LLJVM (via llvm-gcc) and either Jython or JRuby.

如果您不确定使用.NET VM / CLR,那么您可以尝试使用LLJVM(通过llvm-gcc)以及Jython或JRuby来尝试Java VM。

#1


3  

Which interpreted language are you using? If it has a .NET based implementation (e.g. IronPython) you could possibly use it with the C++/CLI compiler to produce byte code for the .NET CLR and Mono.

你使用哪种解释语言?如果它具有基于.NET的实现(例如IronPython),您可以将它与C ++ / CLI编译器一起使用,以生成.NET CLR和Mono的字节代码。

This is only likely to be feasible if you have full control over your C++ libraries.

如果您完全控制C ++库,这可能是可行的。

#2


1  

If you are not sure about using the .NET VM/CLR, then you could give the Java VM a try with LLJVM (via llvm-gcc) and either Jython or JRuby.

如果您不确定使用.NET VM / CLR,那么您可以尝试使用LLJVM(通过llvm-gcc)以及Jython或JRuby来尝试Java VM。