开发者

LLVM CIL and Java Bytecode backend [closed]

开发者 https://www.devze.com 2023-03-16 02:44 出处:网络
Closed. This question is seeking recommendations for books, tools, software libraries, and more. It does not meet Stack Overflow guidelines guidelines. It is not currently accepting answers.
Closed. This question is seeking recommendations for books, tools, software libraries, and more. It does not meet Stack Overflow guidelines guidelines. It is not currently accepting answers.
开发者_如何转开发

We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.

Closed 4 years ago.

Improve this question

I saw the http://vmkit.llvm.org/ project but it's not quite what I'm looking for. Don't want my code to run on yet another VM but on .NET's and Java's VM.

Are there any compiler backends for LLVM that generate .NET CIL and/or Java Bytecode?


LLVM is on a much lower level than CIL and Java byte code. This means that it is difficult to map the LLVM instructions on to CIL and Java instructions, and nobody has really needed it yet so the work has not been done completely.

Some of the work has been done though. See http://llvm.1065342.n5.nabble.com/JVM-Backend-tp41356.html to see if it is useful to you.


EDIT 2020-09-03: Since this answer was written, WebAssembly has been defined which is essentially a cross platform machine language definition which runs in all major browsers and hopefully soon also natively on Linux and others. I would think that the future would be that everything distributes in this format and then is run on the appropriate virtual machine. This will most likely end the CPU wars.


C++ can be compiled to CIL (with visual C++/CLI compiler), so why not a CIL backend for LLVM?
I don't think it would be so complicated as far as the not .NET specific CIL instruction set
is quite small/simple. Compiling C++ to Java is much more complicated because there are no pointer instructions in Java's bytecode, so a Java's bytecode LLVM backend would be much more complicated.

I guess guys from MONO LLVM backend have already worked on something similar, but it seems they exploited LLVM in a different way because MONO is a C# compiler not a C++ compiler.

0

精彩评论

暂无评论...
验证码 换一张
取 消