From: Christian Neukirchen Date: 2006-04-29T22:56:02+09:00 Subject: Re: A proposal for Parsing Ruby in Ruby Logan Capaldo writes: > On Apr 28, 2006, at 8:54 AM, Christian Neukirchen wrote: > >> Kevin Tew writes: >> >>> The control structure of >>> Pugs::Compiler::Rules, continuation passing style(CPS), is easily >>> implemented in Ruby using Procs. >> >> Does that scale given Ruby does not perform tail call optimization? >> > > Maybe not, but on the other hand, ruby does have real continuations. > Maybe he can try doing CPS with Cs instead of Procs. He certainly can try, but in my experience, they scale even less. :-P However, he probably can reclaim the stack space with exceptions or catch/throw. > I personally think this is kind of a silly idea. Perl6 rules are > cool, but they are very very Perl. Regular expressions on steroids, > not very OO. I think a ruby in ruby project would be much better > served by a parser combinator library. The problem is having a > performant one in ruby. I don't think it's a silly idea, and parsing per-se is not a very object-oriented task. Perl6 rules can be implemented using parser combinators pretty easily (check the Pugs source for details. :-)), so if that approach is taken, everyone benefits. I, for one, would welcome having Perl6 rules or a Rubyish feel-alike as a Ruby library. -- Christian Neukirchen http://chneukirchen.org