views:

273

answers:

2

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.

Possible and/or available?

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

+3  A: 

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.

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

richj
I honestly hadn't thought of doing that.
Matt
Using Mono may not be the most stable way to accomplish this. Especially for Python, which already has portable ways to distribute C extensions.
Chris Lutz
Using the standard approach, the Python code is portable, but the C/C++ libraries have to be recompiled for each platform. The standard approach might have advantages over the CLR/Mono approach, but it doesn't meet the "ship one set of libs which are interpreted by one platform specific interpreter" requirement for the C/C++ libraries.
richj
@richj - My point is that you can just ship the C source, and let the receiver compile it the normal way.
Chris Lutz
+1  A: 

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.

spong