Em Qua, 2009-03-25 às 23:11 -0500, jason switzer escreveu: > S01 says that perl5 code will be supported via "use v5". Can someone confirm > that embedded perl5 code is still required of any valid implementation?
I wouldn't think it would be a really bad idea if inline "use v5" inside Perl 6 code to be optional for 6.0.0 > If so, how will XS code be supported? Well, XS code certainly needs to be ran inside a perl5 interpreter. > Will the namespace between v5 code and v6 be shared? the definition of namespace in Perl 6 is very much different from the p5 one. In Perl5 all namespace is global... which is not the case for Perl 6, where the namespace is lexically built (of course you still have GLOBAL::, but that's a minor issue). So, in my head, you have the Perl 6 GLOBAL:: package as a different thing than the p5 ::main namespace... maybe somehow we alias it as GLOBAL::v5::main or something like that... but when you "use Foo:from<perl5>", it certainly doesn't automatically get into the GLOBAL:: Perl 6 namespace (unless you are in GLOBAL::, of course), so the p5 package is imported as a lexical alias in the current scope. > Will this be accomplished by linking libperl linking libperl is certainly the most sane way to implement such backward compatibility. The biggest challenge is the support for reentrancy, since p5 is not entirely stackless. the case of a p6 module that uses a p5 module that uses a p6 module will be the most challenging situation (since p5 recurses in the C stack in that case). There's already a specific plan of merging the p5 runloop with SMOP, in order to make it work: http://www.perlfoundation.org/perl6/index.cgi?smopp5 > I want to propose another idea (that seems better to me at least). This > sounds like a good place where a user module could create a perl5 grammar (a > version of STD.pm). I'm not too familiar with how the perl6 STD.pm works, > but I've heard there were efforts to attach actions to its YAML output, > similar to how Parse::RecDescent does in perl5 to yacc-like grammars. Having a p5 grammar implemented in Perl 6 is not that all a bad idea, to solve the inline problem (even if using libperl to build SV* for the variables)... but I still wonder why would someone write p5 code inlined inside a p6 module? daniel