Mruby – Ruby in your browser
joshnuss.github.io
joshnuss.github.io
I am a big supporter of asm.js after reading John Resig's post on it(http://ejohn.org/blog/asmjs-javascript-compile-target/).
>> class Fixnum; def even?; self%2==0; end; end;
>> (1..100).to_a.select{|i| i.even? }
But some basic things are broken: >> n = 5
=> 5
>> n
=> RuntimeError: arena overflow errorWebruby (Mruby.js) was one of the options we considered but ultimately didn't use.
1000000.times{|i| puts "hello #{i}"}
jquery's $() is aliased to j() in ruby. Try:
j('body').css background: 'pink'
window is alias to w(). E.g.:
w.alert('hello from ruby')
puts w.prompt('saywhat?')