From: Mike Gold Date: 2008-10-23T15:33:56+09:00 Subject: Re: ruby_parser 2.0.0 Released This is amazing work. The Ruby collective superorganism thanks you. Since parse_tree is pure ruby, and is therefore platform-independent and ruby-implementation-independent, I suppose my default choice is ruby_parser over ParseTree. Is there any reason to use ParseTree instead of ruby_parser, other than perhaps speed considerations? I've not used this stuff before, so pardon my ignorance. I can make sexprs from ruby, and I see ruby2ruby which will convert back to ruby. However is there a way to execute sexprs directly? Or is that something rubinius will do? The possibilities boggle the mind. In principle I can write a Lisp program which executes the sexpr output of parse_tree. Now I have another Ruby interpreter. And if it's SBCL, I can generate an executable out of that. Now I have a stand-alone ruby interpreter executable. For the platform-specific stuff, a single Lisp implementation would need to be chosen (probably SBCL). And then there is the possibility of ruby macros. I do see a newly-created defmacro project on rubyforge, however it's currently just 30 lines of code. Do you have any suggestions on what places to look for this kind of thing? I want to be sure I'm not reinventing or co-inventing the wheel. As a practical example, suppose I want to take an .rb file and surgically remove all calls to Kernel#log. That shouldn't be hard, right? Now I need to set up a separate "compilation" phase, assuming I want to keep my Kernel#log calls in the source. Once that's done, here comes defmacro. The compilation phase looks out for defmacro, and does an inline substitution according to whatever rules we decide. The next step is to make a post to comp.lang.lisp saying, "suck it!". --Mike Gold P.S. Don't let the nattering numbskulls of nitwittery bother you. -- Posted via http://www.ruby-forum.com/.