4 ms·
Yes, rewriting Perl 5 in Perl 6 would be quite an endeavor. However, that's why Inline::Perl5 was invented. It lets you use Perl 5 libraries in Perl 6 code:
by muraiki 11y ago
Yes, rewriting Perl 5 in Perl 6 would be quite an endeavor. However, that's why Inline::Perl5 was invented. It lets you use Perl 5 libraries in Perl 6 code:
use Inline::Perl5;
use MyProprietaryModule:from<Perl5>;
use YAML:from<Perl5>; # take advantage of p5 cpan
my $foo = YAML::LoadFile('foo.yaml');
my $bar = MyProprietaryModule.someMethod('baz');
So what this allows you to do is use P6 features where they might benefit your project, but still use all the P5 code you've invested in. There are some cases where Inline::Perl5 has problems, such as running P5 code multithreaded, but aside from that I've had few problems using it with stuff from CPAN and with my company's own proprietary code base.
There are also the modules Inline::Python and Inline::Java (for the JVM backend), but I haven't used them.
- ceronman 11y agoInline::Perl5 is just a very thin layer to communicate with a Perl 5 process. This works well for small things but it's not practical for more complex ones. You can call code of any language from any language using this technique, that doesn't mean the languages are integrated.
- cygx 11y agoNote that no actual IPC is involved: The Perl5 interpreter gets loaded from a shared library and afaict does not run in a separate process.
- raiph 11y agoHave you tried it this year? In his three minute lightning talk in October last year[1] nine demo'd the small things I think you're talking about (calling Python code from within Perl 5 code from within Perl 6 code and using XS-based Perl 5 modules from CPAN). But that talk was merely a snapshot of his progress just a few hours after he began. If you read the examples in the README of Inline::Perl5 as it is today I think you'll see that it is already a lot more capable than you are thinking it is. [2] [1] https://www.youtube.com/watch?v=m_Y-lvQP6jI&list=UU7PuZDAIVMyE7mgkZHunXGw https://www.youtube.com/watch?v=m_Y-lvQP6jI&list=UU7PuZDAIVM... [2] https://github.com/niner/Inline-Perl5 https://github.com/niner/Inline-Perl5