App-perlbrew
App-perlbrew copied to clipboard
perlbrew's role in Perl 5 compatibility with Perl 6 and Perl 6 compatibility with Perl 5
There are several prongs to a strategy of making Perl 5 compatible with Perl 6 and vice-versa but a central piece is Inline::Perl5 which allows use of Perl 5 code in a Perl 6 program and Inline::Perl6 which allows use of Perl 6 code in a Perl 5 program.
In the README for Inline::Perl5, niner notes that:
You will need a perl 5 built with the -fPIC option (position independent code). Most distributions build their Perl 5 that way.
Which is good news. But he adds:
When you use perlbrew, you have to build it as:
perlbrew install perl-stable -Duseshrplib
My naive reaction is to wonder if you would be open to discussing making perlbrew compatible by default with compatibility between Perl 5 and Perl 6.
The main issue relates to -fPIC, which is required to allow these Inlines to work at all. The other issue relates to -Dusemultiplicity, which is required to allow mixing of mullti-threaded P6 programs with multiple P5 threads.
Obviously, it's easy enough for an individual to just perlbrew the perl they want.
But consider the rationale sequence from https://twitter.com/jmaslak/status/1038146774542643200 to https://twitter.com/jmaslak/status/1039657143543029760
Is the best response we can hope for to "portability worries me" to just circulate knowledge of which distros already distribute PIC perls? Is there anything that can be done related to perlbrew, even if it's just a doc tweak pointing out which options are needed to support compatibility between P5 and P6?
Anyhow, I thought it couldn't hurt to ask about your thoughts...
Having slept on this my first thought is that installing Inline::Perl5 could kick off a probe that attempts to establish if there's a perlbrew'd perl, and what options were used to build it, and then build another just for Inline::Perl5, with the necessary options added; or if that doesn't work, installs perlbrew, and attempts to find out what options were used to build the system perl, and then uses those plus the options Inline::Perl5 needs to brew a perl for Inline::Perl5.
Does that strike you as wrong-headed, too magical, a reasonable thing to do, ...?