Hacker News new | past | comments | ask | show | jobs | submit login
Bridging the gap between Perl 5 and 6 (perl6advent.wordpress.com)
9 points by labster on Dec 20, 2016 | hide | past | favorite | 2 comments



Inline::Perl5 is the most well-done, but others are slowly being built and will have just as much support. This is one of the many reasons I call Perl 6 the Polyglot Language. I've worked on Ruby bindings, for example:

    # Calling the CSV Ruby module from Perl 6
    use Inline::Ruby::Sweet;
    use csv:from<Ruby>;
    my $data = CSV.read('examples/hiya.csv')
    #=> «[["id", "name"], ["1", "andy"], ["2", "bella"], ["3", "chad"], ["4", "dua"]]»:rb
Eventually I'll get Inline::* to all auto-load, so you'll just do "use blah:from<YourFavoriteLang>" and presto magic! ... in theory :)


Cross language marshaling of data and exceptions:

    my $mech = WWW::Mechanize.new;
    try {
        $mech.get("xmas://perl6.org");
        CATCH {
            default {
                say $_.perl;
            }
        }
    }




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: