The dd routine is a Rakudo-specific feature, but that's incidental to my question. Is there a way inside a program to check the implementation and bail out if it's not the right one? Do I have to do this on my own?
die "Unsupported VM" unless $*VM ~~ m/^ 'moar' /;
Maybe we need something like Perl 5's Devel::AssertOS.
I'm not at all interested in creating implementation-specific programs, but I can imagine cases where one implementation has particular quirks and bugs that are incompatible with a program. Because, you know, that was Java for several years (remember the MRJ?).
Perl 6 is multi-paradigm, maybe omni-paradigm; it claims to support object-oriented programming, functional programming, aspect-oriented programming, array programming, and (good old) procedural programming.
Perl 6 First Official Release. Released on December 24, 2015, Perl 6 Version 1.0 is also Perl 6.
Raku is a member of the Perl family of programming languages. Formerly known as Perl 6, it was renamed in October 2019.
If you want to run your program only on MoarVM, then:
BEGIN die "Must run on MoarVM, not $*VM.name()" unless $*VM.name eq 'moar';
should be enough.
UPDATE: added BEGIN
as suggested by Jonathan Worthington
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With