新手问题 为什么 ruby 不能编译成二进制

twong_ken · April 21, 2013 · Last by reus replied at April 23, 2013 · 4008 hits

是因为动态类型,没法推导,然后就必须要放在自己的虚拟机上跑么 求普及

1 Floor has deleted

可以有啊,但就是太难听了,Cuby...苦逼啊.... (类比,Python -> Cython)

Cython 也是要虚拟机的吧?

Ruby 可以编译成二进制的。

cython 和 rpython 都编译成 c 的,rpython 有 CLI 和 JVM 的后端 其实 bytecode 也是二进制,lz 意思应该是 native code 能否编译成本地代码和是否动态类型没有关系,而且静态类型语言也可能需要 vm 或者 runtime 的支持

https://github.com/manastech/crystal 、 Crystal is a programming language with the following goals: Have the same syntax as Ruby, or at least as similar as possible. Compile to efficient native code.

rubinius 这类带 jit 的也能在运行时生成本地代码

You need to Sign in before reply, if you don't have an account, please Sign up first.