I'm a geek: hello, world in lua in ruby
> require "rubygems"
> require "rufus/lua"
> s = Rufus::Lua::State.new
> s.eval("print('Hello LUA')")
Hello LUA
=> nil
> require "rubygems"
> require "rufus/lua"
> s = Rufus::Lua::State.new
> s.eval("print('Hello LUA')")
Hello LUA
=> nil
And with ruby 1.9.2p0
sammael:rubyGP greay$ time ruby tinyGP.rb
real 0m12.546s
user 0m11.819s
sys 0m0.631s
MacRuby definitely seems to be the winner here...
I recently started reading A Field Guide to Genetic Programming ... Barely in to it at all yet, but I've decided to rewrite the sample code (TinyGP) in Ruby. Because I like Ruby better than Java.
It's very short. And the (very rough) ruby implementation w/o much anything special done to it is quite a bit shorter – down from 12KB to 8, and I really didn't take anything out. That's just the extra cruft that Java requires. For all I know the ruby implementation is orders of magnitude slower, though, I don't know. Hell, I've barely tested it so I don't even know it works.
The code's @ github.