http://qs321.pair.com?node_id=1158072

syphilis has asked for the wisdom of the Perl Monks concerning the following question:

Hi,
Inline::Perl5 is probably not the recommended entry point to perl6.
But it's, so far, the only aspect of perl6 I've come across that has piqued my interest in perl6 - and it looks like it's going to become *my* entry point (for that given reason).
Nevertheless, I'm happy to apologise for this unorthodoxy on my part if that's deemed appropriate.
(Blame Doug Hunt on the PDL mailing list for having mentioned Inline::Perl5 on the PDL-dev mailing list ;-)

So ... I have a perl5 module named Math::Float128. Basically, it does __float128 arithmetic, and it builds fine on most platforms if you use a recent port of the gcc compiler.
As an exercise, I thought it would be interesting (for me) to access that module and its functionality from perl6.
On Ubuntu 14.04 I have:
sisyphus@sisyphus5-desktop:~/p6$ perl6 -v This is Rakudo version 2015.12 built on MoarVM version 2015.12 implementing Perl 6.c. sisyphus@sisyphus5-desktop:~/p6$ perl -v This is perl 5, version 22, subversion 0 (v5.22.0) built for x86_64-li +nux ....
And, after muddling my way through the installation of Inline::Perl5 (with the assistance of a number of patient monks), I've come up with this perl6 script (which works fine):
use Inline::Perl5; my $p5 = Inline::Perl5.new; $p5.use('Math::Float128'); my $f128 = $p5.invoke('Math::Float128', 'new', '1.2345'); say "$f128"; $f128.print; say ''; # insert the newline say "ok";
That correctly outputs:
sisyphus@sisyphus5-desktop:~/p6$ perl6 use.pl 1.23450000000000000000000000000000009e+00 1.23450000000000000000000000000000009e+00 ok
Based on that it seems to me that the perl5 overloading of "" is being correctly accessed - as that's the only way I can think of that both

say "$f128";
and
$f128.print;

would render correctly.

Is that assessment correct ? (That's my first question).

Inspired by the success of

$f128.print;
I tried
$f128.say;

But that just outputs:
Inline::Perl5::Perl5Object.new(ptr => NativeCall::Types::Pointer.new(1 +00938200), perl5 => Inline::Perl5.new)
Why ? (That's my second question).

Is there a better way to access __float128 arithmetic using perl6 ? (My third and last question ... for tonight ;-)

Cheers,
Rob