Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Favorite Perl 6 feature?

by kal (Hermit)
on Apr 11, 2003 at 09:23 UTC ( [id://249837]=note: print w/replies, xml ) Need Help??


in reply to Favorite Perl 6 feature?

I really like all the new grammar stuff. Being able to write real parsers without having to actually write the parser is going to be great fun. I even heard that it would be possible to write a proper XML parser in pure Perl that would be reasonably quick and efficient, although I'm not sure what values of 'efficient' they were thinking about.

I think my favourite feature, though, is going to not be a language feature at all, but the profile of Perl itself. Perl6 will look a lot more modern a language to Perl5, which has a few crusty idiosyncrasies that we've learned to live with. I'm really hoping that Perl6 will bring new people to the language who may not have otherwise looked at it, and yet still be the Perl we all know and love.

The one feature I want to see in Perl6, which I'm not sure is there yet, would be a really easy way to distribute modules (possibly as Parrot bytecode?). CPAN is great, but I'm thinking more along the lines of what PAR is doing - being able to install cool modules (like Class::DBI ;) on your ISP's hosting environment by FTP, for example, would be amazing.

Replies are listed 'Best First'.
Re: Favorite Perl 6 feature?
by Abigail-II (Bishop) on Apr 11, 2003 at 09:34 UTC
    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

      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.

      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://249837]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (4)
As of 2024-04-19 03:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found