4 ms·
People HAVE written Ruby -> Javascript compilers. Check out Opalrb, Redscript, Coldruby, Hotruby, Webruby... The -> comes from Haskell's lambda syntax (\x ->
by Mikeb85 13y ago
People HAVE written Ruby -> Javascript compilers. Check out Opalrb, Redscript, Coldruby, Hotruby, Webruby...
The -> comes from Haskell's lambda syntax (\x -> x+1). It's a nice solution. 'Def' doesn't really work for lambdas, do does, but curly-brace blocks are nicer in Ruby if you put them everwhere {|x| x+1}... Keep in mind that Javascript is alot like Scheme in that there isn't really a difference between named and anonymous functions. You can write Scheme and Javascript pretty much the same way...
- ChrisAntaki 13y agoGreat points! I really want to check out Scheme now.