How to compile Ruby?

后端 未结 7 1970
青春惊慌失措
青春惊慌失措 2020-12-13 14:22

Is there a tool that can allow me to compile Ruby code so that it runs somewhat faster?

For example, I have heard that there is a tool for Python called \"pyc\" tha

7条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-13 14:31

    In the beginning of 2013 there is not a way to translate Ruby into C/C++ source and then compile it.

    However, I heard Matz (Yukihiro Matsumoto) say that a researcher is creating this tool in Japan. The project should be founded by the Japanese government.

    Otherwise you could use JRuby and compile it in Java byte-code or you could use Rubinius. Rubinius compiles automatically in byte-code (JIT compiler) for the Rubinius VM. It is possible to convert Rubinius in byte-code into LLVM IR and LLVM can generate machine code.

提交回复
热议问题