From: James Britt Date: 2006-05-24T12:15:10+09:00 Subject: Re: Zed and Luis drop the bomb on Ruby's poor performance Douglas Livingstone wrote: > 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 Topher's article[0] at RC&S might be of interest, too. [0] http://www.artima.com/rubycs/articles/patterns_sexp_dsls.html -- James Britt "People want simple stories."