ruby_to_c translates a static subset of ruby to either ANSI or ruby C.
1 2 3 4 5 |
require 'ruby_parser' require 'ruby_to_ruby_c' sexp = RubyParser.new.parse '1 + 1' c = RubyToRubyC.new.process sexp |
Do not use this in production. That’s just crazy.
gem install ruby_to_c
git clone git://github.com/seattlerb/ruby_to_c