Code Monkey home page Code Monkey logo

zavolaj's Introduction

Zavolaj!

This project prototypes native calling interface functionality for
Rakudo.  It should give Rakudo the ability to call out to C libraries
without having to drop to writing PIR).  The Parrot Native Call
Interface gives a similar facility in PIR.

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

The functions that Zavolaj can currently call must have signatures (the
type of the return value and the types of the arguments) that already
exist in a fixed list inside Parrot.  Adding more signatures currently
involves adding entries to the parrot/src/nci/extra_thunks.nci file.

There is a project to enable calling all possible function signatures:
http://github.com/plobsing/parrot-libjit-fb is currently a Parrot
extension.  Zavolaj does not use it yet.

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/fakedbi 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


zavolaj's People

Contributors

cxreg avatar jnthn avatar mberends avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.