Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Native call interface for Rakudo
Perl6 C Perl

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
examples
lib
t
.gitignore
META.info
README
TODO

README

Zavolaj!

This module implements native calling support for Rakudo Perl 6. It builds
on a set of native calling primitives in NQP, adding mapping of Perl 6
signatures and various other traits to make working with native libraries
an easier experience.

The project name is the Slovak translation of the imperative "call!", to
complement Blizkost, a Rakudo-to-Perl-5 integration project.

Thanks for NQP's underlying use of the dyncall library, Zavolaj can now
support arbitrary signatures.

MySQL

Initially the MySQL client library is being used as a test case, because
it is a popular application, is frequently asked about, and because
Parrot does have all the function signatures.  There is a Rakudo project
http://github.com/mberends/minidbi that wraps these functions with a DBI
compatible interface.

The /usr/include/mysql.h file defines the mysql client library functions
and their parameters.

Prepare your system along these lines before trying out the examples:

    $ mysql -u root -p
    CREATE DATABASE zavolaj;
    CREATE USER 'testuser'@'localhost' IDENTIFIED BY 'testpass';
    GRANT CREATE      ON zavolaj.* TO 'testuser'@'localhost';
    GRANT DROP        ON zavolaj.* TO 'testuser'@'localhost';
    GRANT INSERT      ON zavolaj.* TO 'testuser'@'localhost';
    GRANT DELETET     ON zavolaj.* TO 'testuser'@'localhost';
    GRANT SELECT      ON zavolaj.* TO 'testuser'@'localhost';
    GRANT LOCK TABLES ON zavolaj.* TO 'testuser'@'localhost';
    GRANT SELECT      ON   mysql.* TO 'testuser'@'localhost';
    # or maybe otherwise
    GRANT ALL PRIVILEGES ON zavolaj.* TO 'testuser'@'localhost';

You can look at the results via a normal mysql connection:

    $ mysql -utestuser -ptestpass
    USE zavolaj;
    SHOW TABLES;
    SELECT * FROM nom;

SQLite3

This library cannot be called yet because of missing Parrot NCI
signatures, see the example file for details.

Microsoft Windows

The win32-api-call.p6 script shows the beginning of a GUI application
written in Perl 6.

Testing

Before running 'make test', you *must* perform this:

    sudo apt-get install libmysqlclient-dev
    sudo apt-get install libtest-harness-perl
    export PERL6LIB=lib

Something went wrong with that request. Please try again.