可以将java翻译成jruby吗?
既然 jruby 知道如何将 ruby 指令集转换为 java 指令集,那么 jruby 是否也可能知道哪个 ruby 构造对应于给定的 java 指令?
jruby 是否可以将 java 指令反向翻译为 ruby 指令?
到目前为止是否已经实施了类似的措施?
谢谢
Since jruby knows how to translate a ruby set of instruction into java ones, then is it also possible that jruby knows which ruby construct corresponds to a given java instructions?
Is it possible for jruby to make a reverse translation from java instructions to ruby ones ?
Has something similar already been implemented so far?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
就像你不需要知道如何做蛋糕才能吃蛋糕一样,JRuby 不需要知道如何将 java 代码 转换为 ruby 代码,所以我认为你不需要就会发现这个功能。
当然,JRuby 确实知道(值得庆幸的是)如何将一些 Java 类型(特别是基元,还有数组和哈希)转换为它们的 Ruby 等价物,但这不是您所要求的。
Just like you don't need to know how to make a cake in order to eat a cake, JRuby does not need to know how to convert java code into ruby code, so I don't think you will find this feature.
Of course, JRuby does know (thankfully) how to convert some Java types (particularly primitives, but also Array and hashes) into their ruby equivalents, but this is not what you asked.