NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
reusable toolchain? (Score:1)
The approach that everyone seem to be aiming for is that instead of writing PPI all over again for Perl 6, you are supposed to get decent enough support form the actual grammar that ships with the compiler in order to do your own interesting things with it.
Secondly, since Perl 6 supports separate compilation units in many ways this is actually much simpler than Perl 5 - there is no more possibili
Re: (Score:1)
I am probably being thick, but once they code is compiled, haven't you already run the BEGIN block and all its arbitrary contents?
rjbs
Re: (Score:1)
Similarly a macro or grammar extension coming from another compilation unit has already been compiled.
At this point you can examine their code in a manner much like Safe does (existing problems in safe are an implementation issue, not a conceptual one), and run the code with some resource limitation if necessary (if this wasn't possible then we wouldn't have javascript
Furthermore, if you deduced by static analysis that these blocks cannot aff
Re: (Score:1)
You don't need to run Javascript in order to parse it, since it has (I think) a static syntax.
Also, this comes down to practicality.
"What percentage of CPAN can this parsing strategy handle?"
As a context-free document parser, PPI can
Re: (Score:1)
As for reading files etc in BEGIN - that's also handled differently - there is no guarantee that a BEGIN block will run every single time you run the program, it is fair game
Re: (Score:1)
Only if you can solve the Halting Problem.
In Perl 5, even trivial Perl examples involve BEGIN blocks (use strict) and grammar modification (operator/operand switching).
This problem applies to Perl 5 to.
Simon Cozens has a never-released parser based on the Perl internal parser.
It works just fine, as long as the code compi
Re: (Score:1)
No version of the Perl compiler or processor for any version of the language attempts to solve the Halting Problem. They tend to do a pretty good job on most reasonably correct code (and plenty of unreasonably incorrect) code as well. You don't need to solve the Halting Problem. You only need to decide if it's worth it at any particular point to Halt and say "Sorry, I'm not going to continue processing from here," and you can do that if you control the runloo
Re: (Score:1)
If you have a function, and that's all, then you can't find out what's in it.
But given a compiled optree, you have much more information.
If you parse the BEGIN { } block under the current rules, then you wind up with an optree which you can then examine, to see what it does.
As for simon's project - perl 5's parser was never designed to make this easy, it was designed to emit an interpreter optimized optree. This is very different from the design
Re: (Score:1)
You CAN prove something will finish in finite time, you just can't prove how long that finite time is, which may be longer than the heat death of the universe.
One True Grammar (Score:2)
In my "Bird's Eye View of Perl", the talk I give to managers, I talk about Perl being a single language that comes from the same source. The idea of multiple implementations looks good on paper, but it doesn't work out in practice. Besides knowing the core language and its libraries, now the mere mortal users have to wrestle with pecularities of each implementation and grammar. It the reason I s
Re: (Score:1)
Yet, whenever I raise my biggest objection I have against Perl6 (meaningful whitespace), I always get thrown back "well, you can change the grammar you know...".
Re: (Score:2)
Thankfully I haven't seen it come up as much lately. Maybe folks are starting to realize that easily mutable grammars are a powerful and awesome tool but not the sort of thing you want every kid on the block to use.
Re: (Score:1)
At some point you simply HAVE to be able to have an IronPerl6 and JPerl6 simply for long term language flexibility and health.
Re: (Score:2)
I don't see different implementations as necessary to anything. Some people might like it, but in reality people will code to the implementation's features. It happens in Java, Javascript, Lisp, Smalltalk, and probably a lot of others that I haven't used. The conversations at the pub are about who supports what and what you have to do to make good code on one implementation work on another.
It's not so
Re: (Score:2)
Separate grammar from BEGIN blocks? (Score:2)
1) They're safe to execute.
2) The tools can be made aware of grammar changes.
It might not even need to be as restrictive as all that, maybe just that grammar changes happ
Re: (Score:1)
Re: (Score:1)
If "=" is mapped to sub equals, you shouldn't need to run equals while parsing, right?
Re: (Score:1)
Really? It scares you that badly? Wow. (Score:1)
I think it would be great to be able to have parsers/editors/refactor-ers that can "statically" (whatever that means) analyze Perl 6 code and do neat(tm) things with the output. I will write the majority of my Perl 6+ code in the standard grammar using the future best practices for doing so because I think there will be great tools that will give great insigh
Re: (Score:1)
There is a VAST gap between anyone thinks is true and what they can prove.
Personally I DO see reasons why, plenty. Because I spent three years wrestling with them in Perl 5's grammar, several of which are based on mathematically provable impossibilities. And these grammar problems remain in Perl 6 unchanged.
You can't just invoke the "standard grammar" as some kind of magic cure-all.
SOMEONE has to eventually write
Re: (Score:1)
Smart tools (Score:1)
Re: (Score:1)
Perl 6 breaks a ton of existing tools, while relying on the existance of new tools which everybody assumes will exist but nobody has actually proven can be written.
Re: (Score:1)
Besides the fact that the existing tools were written before Perl 6, there is no guarantee they would work with Perl 6 if grammar modifications were disabled. There is no existing tool today that works with perl 6 (other than basic syntax highlighting of various editors). Your entire basis in this thread is about the creation of "new tools which everybody assumes will exist but nobody has actually proven can be written.