From: Eric Hodel Date: 2004-11-11T10:44:09+09:00 Subject: Re: Ruby code generation: string vs. AST based (2.0 or beyond) On Nov 10, 2004, at 5:24 PM, Lothar Scholz wrote: > Hello Eric, > > EH> On Nov 9, 2004, at 10:43 PM, itsme213 wrote: > >>> What are the chances, somewhere in or beyond 2.0, of code generation >>> being >>> based on something more like the following: >>> - write and test executable code >>> - get access to an AST of that code itself >>> - implement code generation by cloning/modifying the AST clone > > EH> Ok, ParseTree is now released, see ruby-talk:119807. If you need > EH> help/ideas pop into irc://irc.freenode.net/#ruby2c. > > But he would still need a "BuildTree". You could emit Ruby code out the other end, instead of reloading the AST. Then run the munged, emitted ruby code back through Ruby. It wouldn't be much different than using gcc. Emitting Ruby code then running it through the interpreter is easier than putting the munged AST back into a live Ruby.