At 7:16 AM +0900 12/19/02, Mark Probert wrote: >Hi. > >At 05:15 AM 12/19/2002 +0900, Dan wrote: >>At 2:25 PM +0900 12/18/02, Gavin Sinclair wrote: >>> >>>So let me get this straight. A *compiled* Ruby program executes eval by >>>running an *interpreter*. Awesome... >> >>Nope. A compiled Ruby program executes eval by running the embedded >>compiler and executing the compiled code. Programs can generate >>executable code internally on the fly--it's not *that* difficult... > >In fact this is the heart of Forth, where you create new words >that are compiled on the fly. > >Though I am sure that Dan has something more sophisticated in >mind than a simple TIL compiler using sub-routine threading... :-) Just a little, though that's a good place to start. It's actually a good foundation method for compilation. While it's got some limitations that you won't have with more sophisticated methods, it does have the advantage of not requiring the implementer have a PhD or be mad. (Or both :) It's also a very fast method, as it's essentially substitution task that doesn't require much logic. -- Dan --------------------------------------"it's like this"------------------- Dan Sugalski even samurai dan / sidhe.org have teddy bears and even teddy bears get drunk