From: Douglas Livingstone Date: 2006-05-24T11:24:00+09:00 Subject: Re: Zed and Luis drop the bomb on Ruby's poor performance 2006/5/24, Logan Capaldo : > > How about we rewrite the ruby runtime as a combination of macros and > functions in Lisp, use ParseTree to get the S-Exp representation of a > ruby program and then feed that into our Lisp compiler? Instant > speedy ruby! ;) > With an install of ParseTree: $ cat example.rb #!/usr/local/bin/ruby def sum(a, b) return a+b end a = 3 b = 4 c = pythag(a, b) puts c $ cat lispify.rb #!/usr/local/bin/ruby def lispify(code) code.gsub!(/[:,]/, '') code.gsub!(/\[/, '(') code.gsub!(/\]/, ')') end code = $stdin.read puts lispify(code) $ cat example.rb | parse_tree_show -f | ./lispify.rb ((defn sum (scope (block (args a b) (return (call (lvar a) + (array (lvar b))))))) (lasgn a (lit 3)) (lasgn b (lit 4)) (lasgn c (fcall pythag (array (lvar a) (lvar b)))) (fcall puts (array (lvar c)))) So, it looks like Lisp to me! Now, some macros? Douglas