开源虚拟机
我正在寻找一个开源虚拟机,它具有:
- 快速和尽可能轻量级
- 支持最小的字节码集(如 LLVM IR),
- 可以轻松地从 C++ 应用程序
- 嵌入平台(Linux、Windows 和 OS X)
- x86 支持
I'm looking for an open source virtual machine that's:
- fast and as lightweight as possible
- supports a minimal set of bytecode (like LLVM IR)
- easily embedable from a C++ application
- Cross platform (Linux, Windows and OS X)
- x86 support
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
Lua 因其极其容易嵌入到 C/C++ 中而闻名。它的VM是开源且跨平台的,非常小(exe大小和字节码指令集),同时速度相当快。但它的字节码可能不适合您的语言。 字节码格式记录在此处。
Lua is famous for being ridiculously easy to embed in C/C++. Its VM is open source and cross-platform, very small (both exe size and bytecode instruction set) and at the same time quite fast. But its bytecode may be not suitable for your language. The bytecode format is documented here.
NekoVM 是一种编程语言和轻量级虚拟机,设计为编译器编写者的通用目标。 文档使得将VM嵌入到C或C++应用程序中看起来非常容易,但VM似乎API 尚未记录。
NekoVM is a programming language and a lightweight virtual machine designed as a generic target for compiler writers. The documentation makes it seem really easy to embed the VM in a C or C++ application, but it seems the VM API is not yet documented.
为什么要过滤掉 LLVM ?它是一组C库
我想它不像Lua那么容易嵌入,但是LLVM 是如此出色,以至于它可能会克服集成它的麻烦。请参阅这个问题,有帮助吗?
Why filter out LLVM ? It's a set of C libraries
I guess it's not as easy to embed than Lua, but LLVM is so great that it would probably overcome the hassle of integrating it. See this SO question, does it help ?
其他可能的答案:为什么不输出汇编程序呢?它快速且轻量级,而且您根本不需要虚拟机。由于您仅针对 x86,因此这可能是有意义的,具体取决于您想要做什么。
Other possible answer : why not output assembler instead ? it's fast and lightweight, and you don't need a VM at all. Since you target x86 only, it could make sense, depending on what you're trying to do.