RubyFluxRuby代码转Java的工具
RubyFlux 是一个编译器,用来将 Ruby 代码转成对应的 Java 代码,并可在 JVM 中运行,而无需其他运行环境的要求。
每个 Ruby 类生成一个对应的 Java 文件。
使用示例:
# The file we want to compile
$ cat fib.rb
def fib(a)
if a < 2
a
else
fib(a - 1) + fib(a - 2)
end
end
puts fib(40)
# First need to build the compiler's jar
$ mvn package
<maven noise>
# Provide the target file to 'rake run'.
#
# The Ruby sources are translated to .java and all support code is copied out
# of RubyFlux for the compilation step. That source is then compiled and run.
# to compile
$ rake run[fib.rb]
jruby -I target:src/main/ruby src/main/ruby/ruby_flux.rb fib.rb
javac fib.java
java fib
102334155
评论
J2CJava转C++代码工具
J2C将Java代码转成C++代码,这是源码级别的转换,输出的C++代码是有效的代码。转换的代码效果请看:http://www.oschina.net/code/snippet_12_13002
J2CJava转C++代码工具
0
Java GemsJava代码分享工具
JavaGems是一个简单的代码片断,不断的从一个项目复制到另外一个项目,经常从你的私有项目复制到几个不同的工作项目,这些小内容你却不能在java.util和它的子文件夹中找到。JavaGems的主要
Java GemsJava代码分享工具
0