Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Favorite Perl 6 feature?

by Abigail-II (Bishop)
on Apr 11, 2003 at 09:34 UTC ( [id://249841]=note: print w/replies, xml ) Need Help??


in reply to Re: Favorite Perl 6 feature?
in thread Favorite Perl 6 feature?

Well, you will be able to write parsers in perl 6. But will that be "real" parsers, as in "fast"? Because I got the impression it's basically a mixture of perl5 regexes and Parse::RecDescent. Now don't get me wrong, recursive descent parsing is powerfull. But it's also dead slow, because there's hardly any room for optimization. It just comes down to: try all rules in order, backtrack as much as needed. Powerfull, but slow.

Real parsers use LL(1), LR(1) or similar grammars, where looking ahead a fixed, small amount of symbols will determine which rule to apply with no need for backtracking if the rule fails.

Abigail

Replies are listed 'Best First'.
Re: Re: Favorite Perl 6 feature?
by mirod (Canon) on Apr 11, 2003 at 10:39 UTC

    I don't plan to write parser for real huge languages, just to be able to write small-but-complete parsers for any input language my code needs. An XPAth parser for exemple usually does not process large input, or a simplified interface that emits SQL queries, or a simple expression evaluator. For all of those needs the current regexps are not quite powerful enough, and writing the interpreter using Parse::RecDescent or YAPP is sometimes not justified. Especially as using native regexps will make it more acceptable for whomever has to maintain the code.

    So for most of the needs I have, the speed of the parser is not a problem, I just like the fact that I will be able to write cleaner and more powerfull "very-little language" interpreters directly within my code.

Re: Re: Favorite Perl 6 feature?
by kal (Hermit) on Apr 11, 2003 at 09:52 UTC

    Well, I think your point is actually quite a general one in a way - there is a lot of stuff that seems to be going in because people might find it useful, rather than addressing something specifically wrong at the moment (although the majority does appear to be addressing actual, practical problems). However, people like TheDamian and Larry seem to have a knack of leading us the right direction..

    I think it's right to have a level of skepticism about the development of Perl6, though, to keep them honest. It would be quite easy, I imagine, to go completely into cloud cuckoo land. The parsers are a good example - they could be very very powerful, but if they're too slow to use, then they won't be useful. Speed, of course, will be a big issue I think in all areas, because I think that's where the Parrot people think they're going to get wins. It will be interesting to see if it lives up to the current expectations :)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://249841]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2024-04-20 15:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found