4 ms·
> isn't Perl 6 a full superset of Perl 5? That depends on what you mean. Perl 6 is carefully designed to be able to smoothly use other programming languages a
by raiph 11y ago
> isn't Perl 6 a full superset of Perl 5?
That depends on what you mean.
Perl 6 is carefully designed to be able to smoothly use other programming languages and their compilers and/or libraries. The most advanced implementation of this concept is (re)use of Perl 5:
use Inline::Perl5;
use DBI:from<Perl5>;
my $dbh = DBI.connect('dbi:Pg:database=test');
# etc.
The first line happens to be valid Perl 5 syntax as well as valid Perl 6. But the next two are Perl 6 code that calls Perl 5 code behind the scenes. In principle those who write such Perl 6 code don't need to know any Perl 5 whatsoever. (In practice current API docs assume use of Perl 5 so there's that.)
The same is true for Python code etc. (though the sugar isn't yet as sweet):
use Inline::Python;
my $py = Inline::Python.new();
$py.run('print "hello world"');
So Perl 6 is either a superset of Perl 5, Pythons, Java, Lua, etc. or it's not a superset of any of them, just good at working with them, depending on how you look at things.