RubyInline
- 授权协议: 未知
- 开发语言: C/C++ Ruby
- 操作系统: 跨平台
- 软件首页: http://www.zenspider.com/ZSS/Products/RubyInline/
软件介绍
RubyInline允许你在ruby代码中直接编写c/c++代码,还会有性能问题吗?
安装方法:sudo gem install RubyInline
示例代码:
class MyTest
def factorial(n)
f = 1
n.downto(2) { |x| f *= x }
f
end
inline do |builder|
builder.c "
long factorial_c(int max) {
int i=max, result=1;
while (i >= 2) { result *= i--; }
return result;
}"
end
end
